Reputation: 4742
I want to access any user's calendar in my Java application.
In https://portal.azure.com, I created an Azure Active Directory: aniketorg123
Then I created an app in it: aniketorgapp1
Following are the Redirect URIs that I added:
Then I added some permissions:
Now, in my application I send Oauth authorization request:
This loads the "Pick an account" page. When the user picks an account, I'm getting the following response:
403 Forbidden
Why could I be getting 403 forbidden?
Upvotes: 0
Views: 2295
Reputation: 836
This seemed to be an issue with the sample, which should be fixed now. You can also try changing response_mode=query in the authorization url and that should fix this problem. This was caused by some of the samesite updates that browsers are making.
Upvotes: 1
Reputation: 2447
If you get a 403 forbidden error, make sure that the correct service principal has been added to your publisher account in the Cloud Partner Portal. Follow the steps in the Prerequisites page to add your service principal to the portal.
If the correct service principal has been added, then verify all the other information. Pay close attention to the Object ID entered on the portal. There are two Object IDs in the Azure Active Directory app registration page, and you must use the local Object ID. You can find the correct value by going to the App registrations page for your app and clicking on the app name under Managed application in local directory. This takes you to the local properties for the app, where you can find the correct Object ID in the Properties page, as shown in the following figure. Also, ensure that you use the correct publisher ID when you add the service principal and make the API call.
Reference Document.
Upvotes: 1