0

I am starting to learn Oath 2, i need to get access token from the front end side(angular 2) with out showing the Microsoft login page,there have any option for that, if have please share me , Thank you.

1
  • Can you share with me how you did this. I am struggling to achieve this. I have put a bounty on a question. Commented Apr 13, 2021 at 10:23

1 Answer 1

1

There are two kinds of token which Azure AD could issue.

First is the delegated token which used to delegate the sign-in user. And normally this kind of token required to users sign-in(Authorization Code Grant flow). However if there is a high degree of trust between the resource owner and the client, we can also use Resource Owner Password Credentials flow which using users' username and password in code directly without users participate.

And the second kind of token is delegated the application called app-only token. To acquire this kind of token, we can use the app's key or the certificate without users sign-in(Client credentials flow).

If you were developing with Client credentials flow, you can refer here which acquire the token for Microsoft Graph using Client credentials flow.

Update

To acquire the token using the Client Credentials flow for multi-tenant apps, we need to grant the permission to the application to register the service principal to the customers' tenant. We can use the Code grant flow to grant the permission. More detail about the multi-tenant apps, you can refer here.

To init the code grant flow, you can refer the request sample from here. After the you grant the permission, the customer also could see this application on their portal. Then you can use the the client credentials flow to reacquire the token from customers' tenant.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you So much the 2nd one working fine ,i am get the token from AD..
Then i have another query,as per you mention link ,that is for single tenant,if you don't mind can you tell me how to do in multi tenant as per the way..
I have updated the answer, please let me know if you still have the problem. And based on my understanding, this scenario is very special.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.