Skip to main content
GET
/
v1
/
b2b
/
organizations
/
{organization_id}
/
members
/
{member_id}
/
oauth_providers
/
microsoft
C#
// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft
const stytch = require('stytch');

const client = new stytch.B2BClient({
  project_id: '${projectId}',
  secret: '${secret}',
});

const params = {
  organization_id: "${organizationId}",
  member_id: "${memberId}",
};

client.Organizations.Members.OAuthProviders.Microsoft(params)
  .then(resp => { console.log(resp) })
  .catch(err => { console.log(err) });
{
  "request_id": "<string>",
  "provider_type": "<string>",
  "provider_subject": "<string>",
  "access_token": "<string>",
  "access_token_expires_in": 123,
  "id_token": "<string>",
  "scopes": [
    "<string>"
  ],
  "status_code": 123,
  "refresh_token": "<string>"
}
Retrieve the saved Microsoft access token and ID token for a . After a successful login, Stytch will save the issued access token and ID token from the identity provider. If a refresh token has been issued, Stytch will refresh the access token automatically.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

organization_id
string
required

Globally unique UUID that identifies a specific Organization. The organization_id is critical to perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id here as a convenience.

member_id
string
required

Globally unique UUID that identifies a specific Member. The member_id is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member.

Query Parameters

include_refresh_token
boolean

Whether to return the refresh token Stytch has stored for the OAuth Provider. Defaults to false. Important: If your application exchanges the refresh token, Stytch may not be able to automatically refresh access tokens in the future.

Response

Successful response

request_id
string
required

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.

provider_type
string
required

Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc.

provider_subject
string
required

The unique identifier for the User within a given OAuth provider. Also commonly called the sub or "Subject field" in OAuth protocols.

access_token
string
required

The access_token that you may use to access the User's data in the provider's API.

access_token_expires_in
integer<int32>
required

The number of seconds until the access token expires.

id_token
string
required

The id_token returned by the OAuth provider. ID Tokens are JWTs that contain structured information about a user. The exact content of each ID Token varies from provider to provider. ID Tokens are returned from OAuth providers that conform to the OpenID Connect specification, which is based on OAuth.

scopes
string[]
required

The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes.

status_code
integer<int32>
required

The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.

refresh_token
string

The refresh_token that you may use to obtain a new access_token for the User within the provider's API.