Authorization Endpoint
OAuth Endpoints
Authorization Endpoint
API reference for the Mubarokah ID OAuth 2.0 Authorization Endpoint (/oauth/authorize).
GET
Authorization Endpoint
Authorization Endpoint
This endpoint initiates the OAuth 2.0 authorization process. Your application redirects the user’s browser to this endpoint to request their consent for accessing their Mubarokah ID data.Parameters
Must be
code. Indicates that your application is requesting an authorization code.Your application’s unique Client ID, obtained during registration.
The URL where Mubarokah ID will redirect the user after they authorize (or deny) your application. This URL must exactly match one of the redirect URIs registered for your application.
A space-separated list of scopes your application is requesting (e.g.,
view-user detail-user). If not provided, a default set of scopes may be assumed or result in an error, depending on server configuration.An opaque value used by your application to maintain state between the request and callback. It’s also used to prevent Cross-Site Request Forgery (CSRF) attacks. This value will be returned to your application as part of the redirect URI. Highly Recommended.
Optional. Valid values include:
-
-
-
consent: Forces the consent screen to be shown even if the user has previously authorized your application for the requested scopes. -
login: Forces the user to re-authenticate even if they have an active session.Optional. Set to
true to bypass the account chooser screen if the user has already authorized your application with their current account. This is useful for providing a seamless experience when re-authorizing or performing silent authentication.Used for PKCE (Proof Key for Code Exchange). The Base64 URL-encoded SHA256 hash of the
code_verifier. Required for public clients (e.g., mobile apps, SPAs) that cannot securely store a client secret.Used for PKCE. Specifies the method used to derive the
code_challenge. Must be S256 if code_challenge is provided.Example Request URL Construction
Here’s how you might construct the authorization URL in JavaScript:Remember to replace placeholder values like
your_app_client_id and https://yourapp.com/oauth/callback with your actual application details.
The state parameter is crucial for security. Generate a unique, unguessable value for each authorization request and validate it upon callback.Responses
Upon successful user authentication and authorization, Mubarokah ID redirects the user’s browser to your specifiedredirect_uri with an authorization_code and the state parameter.
Example Success Redirect:
error parameter.
Example Error Redirect: