is it possible to exchange SAMLv2 token issued by Azure AD for a Microsoft Graph access token

2024-07-07T21:06:33.8166667+00:00

we have offline application which needs to access Graph API

User login is done using SAML app registered with AAD and got SAML Assertion.

when used this SAML assertion to get access token getting below error.

{"error":"invalid_request","error_description":"AADSTS50107: The requested federation realm object 'https://sts.windows.net/2c795858-59ad-4411-88b0-91f104cae98a/' does not exist. Trace ID: 2cfa03d2-e7cc-4fa6-8eb9-cd5e44596e00 Correlation ID: bdcac5d1-d897-4406-935b-3aad07d7a76b Timestamp: 2024-07-07 21:04:55Z","error_codes":[50107],"timestamp":"2024-07-07 21:04:55Z","trace_id":"2cfa03d2-e7cc-4fa6-8eb9-cd5e44596e00","correlation_id":"bdcac5d1-d897-4406-935b-3aad07d7a76b","error_uri":"https://login.microsoftonline.com/error?code=50107"}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,471 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,683 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Navya 6,850 Reputation points Microsoft Vendor
    2024-07-08T10:00:58.3633333+00:00

    Hi @Dasaraju, Chandra Sekhar Varma (External)

    Thank you for posting this in Microsoft Q&A.

    is it possible to exchange SAMLv2 token issued by Azure AD for a Microsoft Graph access token

    No, it is not possible to exchange SAMLv2 token issued by Azure AD for a Microsoft Graph access token. You can Exchange a SAML token issued by AD FS for a Microsoft Graph access token.

    User's image

    For your reference: Exchange a SAML token issued by AD FS for a Microsoft Graph access token

    Hope this helps. Do let us know if you any further queries.

    Thanks,

    Navya.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.