我正在尝试使用android中的auth0进行记录我正在为IdToken中的userId设置一些额外值的自定义范围我在postman上获取此值。但在android中,auth0不会在令牌中返回userId。 setScope不起作用。我将不胜感激任何帮助。
private AuthSessionManager(){
storage = new SharedPreferencesStorage(ContextProvider.get());
auth0 = new Auth0(getAuth0ClientId(),getAuth0Domain());
auth0.setLoggingEnabled(true);
auth0.setOIDCConformant(true);
authApiCli = new AuthenticationAPIClient(auth0);
}
public Credentials loginWithEmailAndPassword(String email, String password){
Log.i(TAG, "loginWithEmailAndPassword: Scope: "+getAUTH0SCOPE());
Log.i(TAG, "loginWithEmailAndPassword: Device: "+getAUTH0DEVICE());
return authApiCli.login(email,password,getAuth0Connection())
.setScope(getAUTH0SCOPE())
.setDevice(getAUTH0DEVICE())
.execute();
}
IdToken:
...
"first_login": false,
"email_verified": true,
"user_id": "userid", // does not return in android
...