I’m trying to get a list of linked accounts, but userinfo does not return identities. Here is My token request:
var client1 = new RestClient($"https://{auth0Domain}/oauth/token");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json",
new JavaScriptSerializer().Serialize(new
{
response_type = "token id_token",
grant_type = "password",
username = email,
password = password,
scope = "openid",
client_id = ConfigurationManager.AppSettings"auth0:ClientId"],
client_secret = ConfigurationManager.AppSettings"auth0:ClientSecret"],
audience = $"https://{auth0Domain}/api/v2/"
}), ParameterType.RequestBody);
IRestResponse response = client1.Execute(request);
var content = new JavaScriptSerializer().Deserialize<dynamic>(response.Content);
It returns id and access tokens and a list of scopes:
openid profile email address phone read:current_user update:current_user_metadata delete:current_user_metadata create:current_user_metadata create:current_user_device_credentials delete:current_user_device_credentials update:current_user_identities
I tried both id and access tokens as a bearer for userinfo request with no luck. Here is the response:
{“sub”:“auth0|aaaaaaaaaaaa”,“nickname”:“name”,“name”:"email@gmail.com",“picture”:“https://s.gravatar.com/avatar/321dc96585bc?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fss.png",“updated_at”:“2017-12-05T23:21:01.382Z”,“email”:“email@gmail.com”,"email_verified”:false}
As I understand I need read:current_user_identities scope, but I do not see it on the management dashboard.
What am I doing wrong?