Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App is not rendered when user doesn't have First name and Last name (not required in AD) #96

Open
J-theGit opened this issue Nov 29, 2019 · 0 comments

Comments

@J-theGit
Copy link

Hi,
I stumbled upon a bug where the app will not be rendered (blank white screen) when the user doesn't have First name and/or Last name setup in Azure AD.
In this scenario the Azure AD authentication succeeds, but react-adal will not render the app (the require below will not run)

import { runWithAdal } from 'react-adal';
import { authContext } from './config/adalConfig';

const DO_NOT_LOGIN = false;


// auth with Azure AD. ADAL will handle entire auth
runWithAdal(authContext, () => {

    // eslint-disable-next-line
    require('./indexApp.js');

}, DO_NOT_LOGIN);

This is my adal config:

import { AuthenticationContext } from 'react-adal';

export const adalConfig = {
    tenant: process.env.REACT_APP_AD_TENANT,
    clientId: process.env.REACT_APP_AD_CLIENTID,
    redirectUri: process.env.REACT_APP_SELF_DOMAIN,
    endpoints: {
        api: process.env.REACT_APP_AD_ENDPOINT,
    },
    cacheLocation: 'sessionStorage',
};

export const authContext = new AuthenticationContext(adalConfig);

export const getToken = () => authContext.getCachedToken(adalConfig.clientId);
export const getUser = () => authContext.getCachedUser(adalConfig.clientId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant