How to get access package information using graph azure api

GKaur 0 Reputation points
2023-09-05T00:31:07.11+00:00

I am bringing user in AD as guest using B2B .I want to read access package request information of signed user . Ho can I read information using azue graph api in my app ? how can I authenticate guest user using azure authentication to access my app ?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,044 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 42,031 Reputation points
    2023-09-05T08:08:31.61+00:00

    Hi @GKaur

    Of course, if the target user has joined your tenant as a guest, its authentication method is no different from that of a member user.

    Since this involves user login, you need to use a delegated authentication flow to obtain an access token, such as the auth code flow.

    First run the authorization URL in the browser and log in to the app using the guest user to get the authorization code.

    https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/authorize?
    client_id={client id}
    &response_type=code
    &redirect_uri={redirect url}
    &response_mode=query
    &scope={scope}
    &state=12345
    

    Then use the authorization code to redeem the access token.

    POST /{tenant}/oauth2/v2.0/token HTTP/1.1
    Host: https://login.microsoftonline.com
    Content-Type: application/x-www-form-urlencoded
    
    client_id={client id}
    &scope={scope}
    &code=OAAABAAAAiL9Kn2Z27UubvWFPbm0gLWQJVzCTE9UkP3pSx1aXxUjq3n8b2JRLk4OxVXr...
    &redirect_uri={redirect url}
    &grant_type=authorization_code
    &client_secret={client secret} 
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.