oidc-react icon indicating copy to clipboard operation
oidc-react copied to clipboard

Cannot Populate UserData

Open Ed-Marcavage opened this issue 3 years ago • 3 comments

I am implementing oidc-react in my typescript react app using the ChakraUI component Lib. I am trying to Auth with Azure AD, it successfully redirects the user back to the web page (hosted locally) after authenticating. However, I cannot get UserData to populate (see screen shot). I have pasted snippets of my implementation below. The goal is to gather user info from the SAML assertion with AzureAD, which I believe should be stored in UserDate?

/src/index.tsx

root.render(
  <React.StrictMode>
    <AuthProvider
    authority="https://login.microsoftonline.com/____________________________"
    clientId="______________________"
    redirectUri="http://localhost:3002"
    loadUserInfo
    >
    <ColorModeScript />
    <ChakraProvider theme={theme}>
      <App />
    </ChakraProvider>
    </AuthProvider>
  </React.StrictMode>
);

simply return useAuth to the console for testing/seeing the UserData values /src/App.tsx

export const App = () => {
  const auth = useAuth();
  console.log(auth)
....

Screen Shot 2022-10-20 at 11 33 31 AM

Ed-Marcavage avatar Oct 20 '22 15:10 Ed-Marcavage

any update on this? I am having the same issue. Identity provider redirects back to app, but isLoading is true and userData is null

GNUGradyn avatar Feb 20 '23 16:02 GNUGradyn

I have the bug too, please provide a solution

MaelthiS avatar Apr 04 '23 06:04 MaelthiS

Hello, @MaelthiS, @GNUGradyn and @Ed-Marcavage!

Feel free to work on a solution :)

simenandre avatar Apr 04 '23 11:04 simenandre