Skip to main content
  This guide explains how builder apps can use the OAuth 2.0 Authorization Code Grant flow to obtain delegated user authorization and access MSU resources via the OpenAPI. It covers the full token lifecycle: issuance, refresh, introspection, and revocation.

Overview

Phase 1. User Authentication & Token Issuance

Authenticate the user via Authorization Code Grant and issue Access Token and Refresh Token.

Phase 2. Token Refresh

Use the Refresh Token to renew an expired Access Token.

Phase 3. Token Introspection

Validate the Access Token and retrieve its metadata.

Phase 4. Token Revocation

Revoke the Refresh Token on logout.

Sequence Diagram


Phase 1 — User Authentication & Token Issuance

1

User initiates login

The user clicks the login button in the builder app.
2

Authorization Code request

The builder app redirects to the OAuth server’s authorization endpoint (/oauth/authorize) to obtain an Authorization Code. The request includes the app’s OAuth Client ID and Redirect URI as query parameters.
The redirect_uri must exactly match the URI registered with the OAuth client.
3

Redirect to login page

The OAuth server detects that the user has no valid session and redirects the browser to the login page.
4

Login page request

The user’s browser requests the login page from the MSU server following the redirect.
5

Login screen provided

The MSU server serves a wallet address-based login form to the user’s browser.
6

User logs in

The user submits a login request to the MSU server using their wallet address.
7

Login success response

The MSU server processes the login and returns a success response.
8

Re-request Authorization Code

After login is complete, the builder app re-requests an Authorization Code from the OAuth server.
9

Authorization Code delivered

The OAuth server redirects to the redirect_uri provided in the request, delivering the Authorization Code.
10

Token issuance request

The builder app sends the Authorization Code to the OAuth token endpoint (/oauth/token) with client credentials via HTTP Basic Auth.
11

Access Token & Refresh Token delivered

The OAuth server validates the Authorization Code and client credentials, then issues and returns the tokens.

Phase 2 — Token Refresh

1

Token refresh request

When the Access Token expires, use the Refresh Token to request a new one from the OAuth token endpoint (/oauth/token).
2

New Access Token & Refresh Token issued

The OAuth server validates the Refresh Token and issues a new Access Token and Refresh Token.

Phase 3 — Token Introspection

1

Token introspection request

To verify whether an Access Token is valid, send a request to the OAuth Introspect endpoint (/oauth/introspect).
2

Introspection result returned

The OAuth server returns the validation result along with token metadata such as issuer, expiration, and subject.

Phase 4 — Token Revocation

1

Token revocation request

To invalidate a Refresh Token, send a request to the OAuth Revoke endpoint (/oauth/revoke).
2

Revocation success response

The OAuth server invalidates the token and returns a success response (200 OK).

For detailed API specifications of each endpoint, refer to the individual pages under the OAuth section.