Skip to content

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

Description

@J-theGit

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions