import * as React from 'react';
import { AuthenticationContext, adalFetch, adalGetToken, runWithAdal, withAdalLogin, AdalConfig } from 'react-adal';
const resourceUrl = 'https://graph.microsoft.net';
const adalConfig: AdalConfig = {
cacheLocation: "localStorage",
clientId: '9ha8cqc6-4668-459a-9272-f48c80a053y5',
endpoints: {
api: resourceUrl
},
postLogoutRedirectUri: 'https://localhost:3000',
tenant: 'tenantname.onmicrosoft.com'
};
const authContext = new AuthenticationContext(adalConfig);
const adalApiFetch = (fetch: any, url: string, options: any) => {
return adalFetch(authContext, resourceUrl, fetch, url, options);
};
const getToken = () => adalGetToken(authContext, resourceUrl);
class App extends React.Component {
render() {
return null;
}
}
// user must login to use the app
runWithAdal(authContext, () => {
// ReactDOM.render(