Select to view content in your preferred language

Present OAuth without displaying Maps

304
1
Jump to solution
06-19-2024 05:33 AM
zdtorok
Occasional Contributor

Can I trigger an OAuth authentication flow without presenting the map?

I found this in the Samples code you provide: https://github.com/Esri/arcgis-maps-sdk-swift-samples/blob/main/Shared/Samples/Authenticate%20with%2...

But here, it is attached to the displayed map. I would need a solution that when our application starts - before rendering our Map component at all - we start the authentication flow with the built-in handling.

Is it possible? Thanks.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
zdtorok
Occasional Contributor

Seems I overlooked the migration guide from 100.x to 200.x as there is a solution for it: https://developers.arcgis.com/swift/reference/migrate-authentication-100-x-to-200-x/

More precisely, this:

 

// OAuth user credential
let configuration = OAuthUserConfiguration(portalURL: portalURL, clientID: clientID, redirectURL: redirectURL)
let oAuthUserCredential = try await OAuthUserCredential.credential(for: configuration)

 

 

 

View solution in original post

1 Reply
zdtorok
Occasional Contributor

Seems I overlooked the migration guide from 100.x to 200.x as there is a solution for it: https://developers.arcgis.com/swift/reference/migrate-authentication-100-x-to-200-x/

More precisely, this:

 

// OAuth user credential
let configuration = OAuthUserConfiguration(portalURL: portalURL, clientID: clientID, redirectURL: redirectURL)
let oAuthUserCredential = try await OAuthUserCredential.credential(for: configuration)