authorization code as returned by IdP during authorization
a validated bearer token response
An Error with message set to an entry in OAuth2Error,
when the request fails, or the returned token response is invalid.
Generate a URL to attempt authorization with the OP See https://spec.matrix.org/v1.18/client-server-api/#authorization-code-flow
A unique opaque identifier, like a transaction ID, that will allow the client to maintain state between the authorization request and the callback. The app should use this to key the storage for where the rest of the auth context is saved.
The manner in which the IdP should send the secrets back to the app. Defaults to fragment for privacy.
Optionalprompt: string
Optional prompt parameter to pass to the IdP to signal intent, e.g. create for User registration.
Optionalscope: string
The OAuth2 scope to request, will be generated based on the device ID if omitted.
a Promise with the url as a string
Refresh the access token using the given refresh token and the refresh token grant
the token to use to refresh the access token
Revokes the given token
the token to remove
Optionaltype: "access_token" | "refresh_token"
the type of token, acts as a hint to the IdP
Begin OAuth2 device authorization flow.
Optionalscope: string
the scope to request for authorization.
a promise that resolves to a device access token response, or an error response if the user denies authorization or the device code expires.
Polls the OAuth2 token endpoint until we get a device access token response, or encounter an unrecoverable error.
The session returned from a previous call to OAuth2.startDeviceAuthorizationGrant.
a promise that resolves to a device access token response, or an error response if the user denies authorization or the device code expires.
StaticregisterAttempts dynamic registration against the configured registration endpoint. Will ignore any URIs that do not use client_uri as a common base as per the spec.
Auth config from MatrixClient.getAuthMetadata
The metadata for the client which to register, grant_types & response_types & token_endpoint_auth_method will be sanely calculated if omitted.
Promise
Attempt to exchange authorization code for bearer token.
Takes the authorization code returned by the OAuth2 Provider via the authorization URL, and makes a request to the Token Endpoint, to obtain the access token, refresh token, etc.