Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 55 additions & 36 deletions openapi-v3/spid-aa-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,10 @@ tags:
description: Accesso previo consenso v. §2.7
externalDocs:
<<: *lg-spid-aa
- name: authorization
description: |-
Tag definito nelle LG Spid AA per i path authorization e token

servers:
- description: |-
I server devono rispettare una serie di indicazioni
I server devono rispettare una serie di indicazioni
url: https://aa.example/patente/{version}

- description: Development server
Expand All @@ -106,8 +103,11 @@ paths:
Ritorna un timestamp in formato RFC5424
prendendola dal server attuale.
operationId: get_echo
security:
- MODI: []
- ConsensoUtente: [openid, profile, offline_access, "patente:full", "patente:minimal", "patente:boolean"]
tags:
- public
- private
responses:
<<: *common-responses
'200':
Expand All @@ -121,36 +121,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Patente'
/authorization:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rimossi gli endpoint che devono essere descritti tramite l'apposita sezione OIDC

get:
description: |-
blah
tags:
- authorization
servers:
- url: https://aa.example/authorization
description: authorization server
responses:
"200": &200-ok
description: |-
A successful response
content:
application/json:
schema:
type: object

/token:
get:
description: |-
blah
tags:
- authorization
servers:
- url: https://aa.example/authorization
description: authorization server
responses:
"200":
<<: *200-ok

/status:
get:
Expand Down Expand Up @@ -180,14 +150,63 @@ paths:
$ref: '#/components/schemas/Problem'

components:
securitySchemes:
Copy link
Contributor Author

@ioggstream ioggstream Apr 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aggiunti gli Authorization Endpoints usando la sintassi OAS3 specifica di OIDC e aggiunto supporto alternativo per autenticazione MODI quando non c'è bisogno del consenso.

Nell'esempio usiamo sempre lo stesso attribute endpoint, ma è anche possibile usare due endpoint diversi: uno per l'interoperabilità e uno per i browser.

MODI:
type: http
scheme: bearer
bearerFormat: jwt
description: |-
Questo modello prevede il passaggio di un JWT
contenente le seguenti informazioni
conformi alle indicazioni del MODI
eg. basato su [ID_AUTH_REST_01](https://docs.italia.it/italia/piano-triennale-ict/lg-modellointeroperabilita-docs/it/bozza/doc/02_Pattern%20sicurezza/05_accesso-del-fruitore/03_id_auth_rest_01.html)

ConsensoUtente:
description: |-
Questa sezione esplicita il riferimento all'URL di configurazione
di OIDC relativo al provider. Deve contenere le informazioni
indicate in:
[oidc discovery](https://openid.net/specs/openid-connect-discovery-1_0.html)
e simile a quanto visto in [spid oidc](https://docs.italia.it/AgID/documenti-in-consultazione/lg-openidconnect-spid-docs/it/bozza/metadata/openid-provider-op-metadata.html?highlight=metadata)
ad esempio:
```
{
"issuer": "https://aa.spid.it/",
"authorization_endpoint": "https://aa.spid.it/authorize",
"token_endpoint": "https://aa.spid.it/token",
"jwks_uri": "https://aa.spid.it/.well-known/jwks.json",
"scopes_supported": [
"openid",
"profile",
"offline_access",
"patente:full",
"patente:minimal",
"patente:boolean"
],
"response_types_supported": [
"code",
],
"token_endpoint_auth_methods_supported": [
"private_key_jwt"
],
"subject_types_supported":[
"public"
],
...
}

```
type: openIdConnect
openIdConnectUrl: https://aa.spid.it/.well-known/openid-configuration

examples:
403Forbidden:
summary: §2.3 Consenso non fornito
value:
title: Forbidden
status: 403
detail: Consent Required
instance: https://aa.example/authorization
instance: https://aa.spid.it/.well-known/openid-configuration
headers:
Cache-Control:
schema:
Expand Down