Retrieve particle email from token

Looking through the iOS reference, and have seen that you can authenticate either by injecting an access token or by using the user’s particle email address and password.

If just injecting an access token, is it possible to retrieve the associated user’s particle email through another API call somehow? When I just use the access token, any calls to ParticleCloud.sharedInstance().loggedInUsername return nil.

It’s not possible to get the email address from the access token.

Technically it doesn’t even have to be an email address. Two-legged shadow customer identifiers need to be unique, but if you are not using password recovery emails, then could actually be unique opaque identifiers or even a guid.

Thanks, @rickkas7. That’s helpful. I had no idea that you didn’t actually need a valid email address in the customer creation API and could just use a guid. Thanks for that tip. I guess I just never tried it with something that had no @ :smiley: