Skip to main content
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

string
required
Must be code. Indicates that your application is requesting an authorization code.
string
required
Your application’s unique Client ID, obtained during registration.
string
required
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.
string
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.
string
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.
string
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.
string
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.
string
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.
string
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 specified redirect_uri with an authorization_code and the state parameter. Example Success Redirect:
If the user denies authorization or an error occurs, the redirect will include an error parameter. Example Error Redirect:
Refer to the Error Codes section for a list of possible OAuth errors.