How to get the access token from azure using asp.net mvc

Anita 1 Reputation point
2020-07-06T18:00:06.163+00:00

Hi Team,
We just wanted to get the access token of azure using asp.net MVC web application.

We have to use the below line of code to get the azure access token.

Dim authorityUri As String = "https://login.microsoftonline.com/common/oauth2/authorize"
Dim authContext As AuthenticationContext = New AuthenticationContext(authorityUri)
Dim TokenTask = Await authContext.AcquireTokenAsync(resource, ClientCredetial)
Dim getToken = TokenTask.AccessToken()
Return getToken

But we are getting a response to the open azure login page. Can you please help me with this.

Is there any way to get token from azure using asp.net MVC So please suggest Thanks in advance.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,679 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Laude 85,686 Reputation points
    2020-07-06T18:22:29.483+00:00

    Hi,

    ASP.NET MVC is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).

    You can ask the experts in the dedicated ASP.NET MVC forum over here:
    https://forums.asp.net/1146.aspx

    (Please don't forget to accept helpful replies as answer)

    Best regards,
    Leon

    0 comments No comments