Select to view content in your preferred language

Issues with OAuth 2.0 Authentication

228
1
09-11-2024 05:18 AM
ShareUser
Esri Community Manager

A couple of months ago I had set up an OAuth 2.0 credentials application in ArcGIS Online. This has been working to access the feature layers that we needed from my items for the application being created.

Last week one of my colleagues set up an OAuth 2.0 credential application so we could access the layers in their items, we cannot get this to work and I have no idea why.

The only thing we can really find as a difference in the OAuth app is that now when creating it, redirect URLs are required, or when editing the settings it requires a URL or redirect URL, and the existing credentials app that I created a few months ago has neither of these set.

All the sharing and other settings for the layers match as well (give or take some groups, but that wouldn't make a difference) and so do all of the other settings in the OAuth app.

Have there been any changes to the way these apps are set up recently? Or are we missing something else completely obvious?

0 Kudos
1 Reply
ShareUser
Esri Community Manager

Nothing changed in regards to how apps need to be configured for OAuth. In fact `Redirect URLs` were always required. With just description of the issue I can't tell what could be going wrong but I do have a few questions :

What version on Maps SDK for .NET are you using?
What UI framework are you using, WPF, .NET MAUI, WinUI?Is the new OAuth app created on same org/portal as your original OAuth app?
Did you implement any credential persistence in your app?

If you haven't done so, I suggest creating a new simple app just to access the data using new OAuth. You can use the solution in this tutorial to set it up quickly. 

.NET MAUI:
https://developers.arcgis.com/net/security-and-authentication/tutorials/access-services-with-oauth-2...
WPF:
https://developers.arcgis.com/net/security-and-authentication/tutorials/access-services-with-oauth-2...

 

 

0 Kudos