George Host
George Host

Reputation: 988

Microsoft Graph API Problems iOS : Unable to Complete Request Validation Error

I have registered my application here. I have given all permissions to my App in that panel as well. I specifically need Groups.ReadWrite.All which requires an admin ? requirement I am not sure what this even means. https://apps.dev.microsoft.com/#/application/

Okay App is registered and redirect url has been copied. Now I take that redirect url copy it and paste it into the admin panel for apps. At this link at App Registrations https://portal.azure.com/

I am not sure why I have to register in two different panels, one which gives me a redirect url for my native app and the other that leaves it blank.

Great So then I setup my iOS app to make a graph request. This scope https://graph.microsoft.com/Calendars.ReadWrite

I need to readwrite groups so I add this permission https://graph.microsoft.com/Group.ReadWrite.All It fails to authenticate.

I have checked that I have added the permissions to my app, and I have at this app registration panel https://apps.dev.microsoft.com/#/application/

Then I try to add the same permissions in the https://portal.azure.com/ it gives me

Unable to Complete Request Validation Error, then doesn't do anything. I tried to add a non admin permission same error.

So what is going on here ... ?

So even though they told me use the Graph API from now on moving forward in the docs I tried to go back to their office 365 SDK for iOS, it also has problems as I cannot get the pods to work as per instructions.

I am 100% sure after this issue is resolved I will need permissions

Note: I work at as a consultant for a bank so if someone can tell me what the azure administrator at the bank has to do to get my permissions escalated to admin status that would be great....

Thanks

Upvotes: 1

Views: 824

Answers (1)

Jason K
Jason K

Reputation: 138

Those are 2 different registrations, Per this documentation (https://graph.microsoft.io/en-us/docs/authorization/auth_overview), for personal accounts like live.com or outlook.com, use the Azure AD v2.0, and for the enterprise, use the Azure AD.

So, for your case, I believe you need the latter, the azure AD.

For this to happen, as you said, go https://portal.azure.com/ and add the app registration.

In order to do so, you would need to

  1. select "Azure Active Directory" and go "App registrations".
  2. Once you create an app, you would need to select "native" for the iOS, and then under app access, under "required permissions" add "Microsoft Graph" followed by selected permissions you would like.

To answer the note, you would need permissions to create an app at the portal, otherwise, you would need to ask for that permission or have the admin create an app for you.

Some samples are available at https://github.com/microsoftgraph/ios-objectivec-connect-sample and https://github.com/microsoftgraph/ios-swift-connect-sample for iOS samples.

Hope this helps!

Upvotes: 2

Related Questions