Skip to content

Commit 6e294ff

Browse files
feat: document the api_platform.oauth.scopes option (#1665)
1 parent cf0ccc8 commit 6e294ff

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

core/openapi.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -587,33 +587,50 @@ If you implemented OAuth on your API, you should configure OpenApi's authorizati
587587
```yaml
588588
api_platform:
589589
oauth:
590-
# To enable or disable oauth.
590+
# To enable or disable OAuth.
591591
enabled: false
592592
593-
# The oauth client id.
593+
# The OAuth client id.
594594
clientId: ''
595595
596-
# The oauth client secret.
596+
# The OAuth client secret.
597597
clientSecret: ''
598598
599-
# The oauth type.
599+
# The OAuth type.
600600
type: 'oauth2'
601601
602-
# The oauth flow grant type.
602+
# The OAuth flow grant type.
603603
flow: 'application'
604604
605-
# The oauth token url.
605+
# The OAuth token url.
606606
tokenUrl: '/oauth/v2/token'
607607
608-
# The oauth authentication url.
608+
# The OAuth authentication url.
609609
authorizationUrl: '/oauth/v2/auth'
610610
611-
# The oauth scopes.
611+
# The OAuth scopes.
612612
scopes: []
613613
```
614614

615615
Note that `clientId` and `clientSecret` are being used by the SwaggerUI if enabled.
616616

617+
### Configure the OAuth Scopes Option
618+
619+
The `api_platform.oauth.scopes` option requires an array value with the scopes name and description. For example:
620+
621+
```yaml
622+
api_platform:
623+
oauth:
624+
scopes:
625+
profile: "This scope value requests access to the End-User's default profile Claims, which are: name, family_name, given_name, middle_name, nickname, preferred_username, profile, picture, website, gender, birthdate, zoneinfo, locale, and updated_at."
626+
email: "This scope value requests access to the email and email_verified Claims."
627+
address: "This scope value requests access to the address Claim."
628+
phone: "This scope value requests access to the phone_number and phone_number_verified Claims."
629+
```
630+
631+
**Note:** if you're using an OpenID Connect server (such as Keycloak or Auth0), the `openid` scope **must** be set according
632+
to the [OpenID Connect specification](https://openid.net/specs/openid-connect-core-1_0.html).
633+
617634
## Info Object
618635

619636
The [info object](https://swagger.io/specification/#info-object) provides metadata about the API like licensing information or a contact. You can specify this information using API Platform's configuration:

0 commit comments

Comments
 (0)