Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetAuthorizationRequestUrlParameterBuilder.ExecuteAsync() method returns wrong datatype #1184

Closed
6 tasks
Rick-Kirkham opened this issue May 30, 2019 · 12 comments
Closed
6 tasks
Assignees
Labels
Milestone

Comments

@Rick-Kirkham
Copy link

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.

@jmprieur
Copy link
Contributor

jmprieur commented Jun 3, 2019

@bgavrilMS fyi

@bgavrilMS bgavrilMS added this to the 4.0 milestone Jun 3, 2019
@bgavrilMS bgavrilMS added the Fixed label Jun 3, 2019
@bgavrilMS
Copy link
Member

Fix will be available in 4.0 release

@jennyf19
Copy link
Collaborator

jennyf19 commented Jun 4, 2019

@Rick-Kirkham Fixed in MSAL 4.0.0 release

@jennyf19 jennyf19 closed this as completed Jun 4, 2019
@Rick-Kirkham
Copy link
Author

@jennyf19 Has 4.0 officially GAed or is it still preview/beta?

@jennyf19
Copy link
Collaborator

jennyf19 commented Jun 4, 2019

@Rick-Kirkham We actually GA'ed w/3.0.8, so 4.0 is also GA.

@Rick-Kirkham
Copy link
Author

??? You GAed two versions at once? Why? I can't make sense of that.

@jennyf19
Copy link
Collaborator

jennyf19 commented Jun 4, 2019

@Rick-Kirkham we GA'ed w/3.0.8 and 4.0 is not in preview or beta. We GA'ed at the beginning of May.

@Rick-Kirkham
Copy link
Author

@jennyf19 Just last week I installed the NuGet package for MSAL in a Visual Studio project. The most recent version available was 3.0.8. There was no 4.0.

@jmprieur
Copy link
Contributor

jmprieur commented Jun 4, 2019

@Rick-Kirkham
what @jennyf19 means is that:

  • MSAL.NET is now General Availability (after being in preview for several years). The first version that was GA is 3.0.8, which is the one you see on NuGet
  • We released today MSAL.NET 4.0.0, which is an increment on top of MSAL.NET 3.0.8, but with a breaking change (which might not even affect you if you rebuild your app), therefore we bumped-up the major version number of the library to respect semantic versionning. MSAL.NET 4.0.0 has the fix to the bug you opened (thanks for that)

@Rick-Kirkham
Copy link
Author

@jmprieur
I see. Thanks. When will 4.0 be available in NuGet?

@jennyf19
Copy link
Collaborator

jennyf19 commented Jun 4, 2019

@Rick-Kirkham It's available now msal 4.0.0

@Rick-Kirkham
Copy link
Author

Got it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants