microsoftgraph / msgraph-sdk-objc

Microsoft Graph SDK for Objective-C
MIT License
37 stars 21 forks source link

Authenticating with macOS #34

Closed SteveDCronin closed 5 years ago

SteveDCronin commented 5 years ago

First, I have, in hand, both a clientID and clientSecret for an app I have successfully registered in the Azure Active Directory.

Since I am building a macOS app but the MSAL library remains iOS only I am attempting to use this 'msgraph-sdk-objc sdk' by authenticating using an open source tool: AppAuth (an openID client).

Using AppAuth I can discover an endpoint like this: [OIDAuthorizationService discoverServiceConfigurationForIssuer:issuer completion:^(OIDServiceConfiguration _Nullable configuration, NSError _Nullable error) {...}];

OR I can fully configure like this: NSURL authorizationEndpoint = [NSURL URLWithString:@"https://accounts.google.com/o/oauth2/v2/auth"]; NSURL tokenEndpoint = [NSURL URLWithString:@"https://www.googleapis.com/oauth2/v4/token"]; OIDServiceConfiguration *configuration = [[OIDServiceConfiguration alloc] initWithAuthorizationEndpoint:authorizationEndpoint tokenEndpoint:tokenEndpoint];

So my question: In the first case above, what would I use as 'issuer'? Where should I have found this information?

In the second case, is there a authorization endpoint and a token endpoint for Azure Active Directory apps? Where should I have found this information?

Thanks for any help here!

SteveDCronin commented 5 years ago

https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-openid-connect-code