microsoft-authentication-library-for-objc
microsoft-authentication-library-for-objc copied to clipboard
Please provide macOS support to msgraph-sdk-objc-auth
Now that 0.5.0 is supporting macOS - please enhance msgraph-sdk-objc-auth so that it too supports macOS. Please?
Hi @SteveDCronin. Thanks for your request. I took a look at the wrapper and there seems to be not much platform specific code. So it should be just adding a macOS target at the first look. I'll reach out to Microsoft Graph folks and see if they're interested in doing that. Thanks for opening the issue in their Github repository already.
Also, looking at the code, I'd like to caution you that the wrapper doesn't implement some more advanced scenarios, like multi-account support or claims request. Additionally, if you need any extra options for your token requests, it might be tricky to implement considering you don't control direct invocation of MSAL if you are using the wrapper. If you need to support any of those advanced scenarios, I'd recommend to call MSAL directly instead to be able to configure it the way you need.
@SteveDCronin Thanks for the feedback. We will definitely add it to our backlog.
Olga;
Thank-you for the thoughtful comment! Darrel added the request to the backlog - that's great. But I have no idea how much time will pass before there is any visible progress...
To your main point: At this time I do not need the advanced capabilities you discuss. I just need basic single app access...
So your comment about proceeding without this is very intriguing - BUT Can you elaborate on what I would need to do instead of this short snippet which is re-stated directly from the readme on this project: NSError *msalError; MSALPublicClientApplicationConfig *config = [[MSALPublicClientApplicationConfig alloc] initWithClientId:kMyClientID]; NSArray<NSString *> *scopes = @[@"https://graph.microsoft.com/Contacts.ReadWrite"]; MSALInteractiveTokenParameters *interactiveParams = [[MSALInteractiveTokenParameters alloc] initWithScopes:scopes]; MSALPublicClientApplication *application = [[MSALPublicClientApplication alloc] initWithConfiguration:config error:&msalError]; [application acquireTokenWithParameters:interactiveParams completionBlock:^(MSALResult *result, NSError *error) { … }];
My best understanding is that there is a ton of code that needs to be generated to accomplish this... I hope my understanding is flawed!
@SteveDCronin, can you please describe what you're trying to accomplish so that we could help you better with a sample code? Thanks.
Olga;
Thanks for the invitation to add clarity. Your participation on GitHub is really appreciated!
I have a registered app in Azure Active Directory portal. BTW: I intend to use the functionality described here for both macOS and iOS - I hope to ultimately have a desktop, tablet, and phone version....
I want to use Microsoft Graph API to create a new contact records - that's the real gist of the functionality I'm looking for.
As a side note, in creating new contacts, I also want to read contact records (offering to utilize the current 'Company' names if a suitable one can be found).
My application's compelling feature is basically that it can extract the elements of the contact record from raw text, speech, or image files. The user is relieved of the tedium of placing the various pieces of data into the correct fields.
For iOS, which I am actively working on now, it seems that the MSAL and Graph support supplied by your Github repositories will be sufficient to authenticate and create new records. I will be deploying my code to accomplish this within the next day or so...
All of my questions to date relate to the macOS version. My macOS Xcode project Pod file includes this: ... pod 'MSGraphClientSDK' pod 'MSAL', '~> 0.5.0' ...
Based on code from the readme associated with this project (microsoft-authentication-library-for-objc) I hope to sign in my macOS client by do this:
NSError *msalError; MSALPublicClientApplicationConfig *config = [[MSALPublicClientApplicationConfig alloc] initWithClientId:kMyClientID]; NSArray<NSString *> *scopes = @[@"https://graph.microsoft.com/Contacts.ReadWrite"]; MSALInteractiveTokenParameters *interactiveParams = [[MSALInteractiveTokenParameters alloc] initWithScopes:scopes]; MSALPublicClientApplication *application = [[MSALPublicClientApplication alloc] initWithConfiguration:config error:&msalError]; [application acquireTokenWithParameters:interactiveParams completionBlock:^(MSALResult *result, NSError *error) { … }]
As you are not doubt aware MSAL provides: MSALPublicClientApplicationConfig, MSALInteractiveTokenParameters, and MSALPublicClientApplication.
However MSAL does not provide: MSALAuthenticationProviderOptions nor MSALAuthenticationProvider.
Therefore I must provide this functionality myself... This frankly seems unnecessary when you have stated your intention to support macOS with this project and have now released support for macOS in MSAL itself.
Hopefully this answers your question. If not please ask any follow-up questions you might have. I really appreciate your reaching out to facilitate my goals. Thank-You.
Steve