pl-api
    Preparing search index...

    Function oauthCategory

    • Parameters

      Returns {
          authorizationServerMetadata: () => Promise<
              {
                  app_registration_endpoint: string;
                  authorization_endpoint: string;
                  code_challenge_methods_supported: string[];
                  grant_types_supported: string[];
                  issuer: string;
                  response_modes_supported: string[];
                  response_types_supported: string[];
                  revocation_endpoint: string;
                  scopes_supported: string[];
                  service_documentation: string;
                  token_endpoint: string;
                  token_endpoint_auth_methods_supported: string[];
                  userinfo_endpoint: string;
              },
          >;
          authorize: (params: OauthAuthorizeParams) => Promise<string>;
          getCaptcha: () => Promise<{ type: string } & { [key: string]: any }>;
          getToken: (
              params: GetTokenParams,
          ) => Promise<
              {
                  access_token: string;
                  created_at?: number;
                  expires_in?: number;
                  id?: string;
                  me?: string;
                  refresh_token?: string;
                  scope: string;
                  token_type: string;
              },
          >;
          mfaChallenge: (
              params: MfaChallengeParams,
          ) => Promise<
              {
                  access_token: string;
                  created_at?: number;
                  expires_in?: number;
                  id?: string;
                  me?: string;
                  refresh_token?: string;
                  scope: string;
                  token_type: string;
              },
          >;
          revokeToken: (params: RevokeTokenParams) => Promise<EmptyObject>;
          userinfo: () => Promise<
              {
                  iss: string;
                  name: string;
                  picture: string;
                  preferred_username: string;
                  profile: string;
                  sub: string;
              },
          >;
      }

      • authorizationServerMetadata: () => Promise<
            {
                app_registration_endpoint: string;
                authorization_endpoint: string;
                code_challenge_methods_supported: string[];
                grant_types_supported: string[];
                issuer: string;
                response_modes_supported: string[];
                response_types_supported: string[];
                revocation_endpoint: string;
                scopes_supported: string[];
                service_documentation: string;
                token_endpoint: string;
                token_endpoint_auth_methods_supported: string[];
                userinfo_endpoint: string;
            },
        >
      • authorize: (params: OauthAuthorizeParams) => Promise<string>

        Authorize a user Displays an authorization form to the user. If approved, it will create and return an authorization code, then redirect to the desired redirect_uri, or show the authorization code if urn:ietf:wg:oauth:2.0:oob was requested. The authorization code can be used while requesting a token to obtain access to user-level methods.

      • getCaptcha: () => Promise<{ type: string } & { [key: string]: any }>

        Get a new captcha

      • getToken: (
            params: GetTokenParams,
        ) => Promise<
            {
                access_token: string;
                created_at?: number;
                expires_in?: number;
                id?: string;
                me?: string;
                refresh_token?: string;
                scope: string;
                token_type: string;
            },
        >

        Obtain a token Obtain an access token, to be used during API calls that are not public.

      • mfaChallenge: (
            params: MfaChallengeParams,
        ) => Promise<
            {
                access_token: string;
                created_at?: number;
                expires_in?: number;
                id?: string;
                me?: string;
                refresh_token?: string;
                scope: string;
                token_type: string;
            },
        >
      • revokeToken: (params: RevokeTokenParams) => Promise<EmptyObject>

        Revoke a token Revoke an access token to make it no longer valid for use.

      • userinfo: () => Promise<
            {
                iss: string;
                name: string;
                picture: string;
                preferred_username: string;
                profile: string;
                sub: string;
            },
        >

        Retrieve user information Retrieves standardised OIDC claims about the currently authenticated user. see https://docs.joinmastodon.org/methods/oauth/#userinfo