Skip to content

Instantly share code, notes, and snippets.

@ghsatpute
Created September 28, 2018 09:34
Show Gist options
  • Save ghsatpute/76c53d68df939d8e126a516f85d773d8 to your computer and use it in GitHub Desktop.
Save ghsatpute/76c53d68df939d8e126a516f85d773d8 to your computer and use it in GitHub Desktop.
Get user info from auth0 access token
class Auth0Test {
void getUserInfoFromAuthToken() {
AuthAPI auth = new AuthAPI("my-domain", "client-id", "client-secret");
String accessToken = "accessToken";
Request<UserInfo> userInfoRequest = auth.userInfo(accessToken);
try {
UserInfo user = userInfoRequest.execute();
} catch(Auth0Exception e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment