Auth0 Home Blog Docs

Trouble decoding credentials token for connection string claim



I’m using Swift 4.1 in an iOS app and can successfully authenticate to Auth0 via the Auth0.webAuth() method in your cocoapods pod. I get back various “claims”, one of which is an “identities” claim which will tell me the connection string. The problem is I see no way to access that key/value pair. I’m trying the following swift code:

let jwtToken = try decode(jwt: credentials.idToken!)
let identities_claim = jwtToken.claim(name: “identities”)
if let identities = identities_claim.array {
print(“Identities array=”,identities)

But the cast to .array is not working. How can I decode the jwtToken for the connection string?