Request an authorization code for the OAuth authorization grant flow when using Lithium Registration.
Used with OAuth for API authentication. See OAuth 2.0 authorization grant flow.
When a community user attempts to access the community, the user must be authenticated in the Community Web UI (via Lithium Registration or SSO). Use GET /auth/oauth2/authorize
when you authenticate to the Community Web UI with Lithium Registration. If authenticating to the Web UI via SSO, use POST /auth/authorize
.
Do this once per user.
After you call /auth/oauth2/authorize
endpoint, the Login Page is displayed. After a successful login submission, the page is redirected to the redirect_uri
value. The redirect URL will contain the authorization code.
Redirect URL format
[REDIRECT-URI-FROM-API-APP]?code=[AUTHORIZATION_CODE]&user-id=[USER-ID]&tenant-id=[TENANT-ID]&state=[A-NON-EMPTY-STRING]
Example request
https://[COMMUNITY-DOMAIN]/auth/oauth2/authorize?client_id=[CLIENT-ID]&response_type=code&redirect_uri=[REDIRECT-URI]&state=[RANDOMLY-GENERATED STRING]
ATLAS
Comments