'How can I display user data (profile, email) through Azure AD OAuth? - Expo App

In my Expo App, I authenticate my users through an Azure AD Login using useAuthRequest, and I pass in the scopes ["openid", "profile", "name"] on my request, as you can see in the extraction below:

const [request, response, promptAsync] = useAuthRequest(
  {
    clientId: `${config.CLIENT_ID}`,
    clientSecret: `${config.CLIENT_SECRET}`,
    scopes: [ 'openid', 'profile', 'email'],
    prompt: 'login',
    redirectUri: "msauth.my-bundle-id://auth",
    returnUrl: "msauth.com.my-bundle-id://auth",
  },
  discovery
  );

How can I display the authenticated users email, name and picture in my app? (The login itself is working correctly)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source