Skip to content

GetAuthorizationRequestUrlParameterBuilder.ExecuteAsync() method returns wrong datatype #1184

Closed
@Rick-Kirkham

Description

@Rick-Kirkham

Which Version of MSAL are you using ?
Latest 3.x.x

Platform
net45

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)
  • Web App
    • [x ] Authorization code
    • OBO
  • Web API
    • OBO

Is this a new or existing app?
c. This is a new app

Repro

string[] graphScopes = { "Files.Read.All", "User.Read" };

ConfidentialClientApplicationBuilder clientBuilder = ConfidentialClientApplicationBuilder.Create(Settings.AzureADClientId);
ConfidentialClientApplication clientApp = (ConfidentialClientApplication)clientBuilder.Build();

var urlBuilder = clientApp.GetAuthorizationRequestUrl(graphScopes);
urlBuilder.WithRedirectUri(loginRedirectUri.ToString());
urlBuilder.WithAuthority(Settings.AzureADAuthority);
var authUrl = await urlBuilder.ExecuteAsync();
authUrl. ????

Expected behavior
According to ConfidentialClientApplication.GetAuthorizationRequestUrl, the method:

Computes the URL of the authorization request letting the user sign-in and consent to the application accessing specific scopes in the user's name. The URL targets the /authorize endpoint of the authority configured in the application.

So, in the code in Repro above, the object returned by GetAuthorizationRequestUrlParameterBuilder.ExecuteAsync() should return a URL or an object with a property that is a URL.

Actual behavior
The GetAuthorizationRequestUrlParameterBuilder.ExecuteAsync() method returns an AuthorizationResult which is not a URL and has no property with a URL in it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions