Skip to content

SeaMonster-Studios/bs-msal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bs-msal

DEPRECATED. Please refer to https://github.com/SeaMonster-Studios/sms-reason

Bindings for microsoft-authentication-library-for-js (msal)

Usage

You'll notice that the intilization function has been simplified from UserAgentApplication to initApp, and that all parameters are named. All optional properties on the optional options object in the original msal have been moved to the root of the function call, also as named parameters. The only required parameters are clientId, authority, and tokenReceivedCallback.

Example

let authApp =
      Msal.initApp(
        ~clientId="CLIENT_ID_HERE",
        ~authority=
          "B2C_AUTHORITY_HERE",
        ~tokenReceivedCallback=
          (_errorDesc, _token, error, _tokenType) => {
            Js.log("Error in tokenReceivedCallback:");
            Js.log(error);
          },
        ~redirectUri="http://YOU_REDIRECT_URI",
        ~postLogoutRedirectUri="http://YOU_LOGOUT_REDIRECT_URI",
        ~storeAuthStateInCookie=false,
        ~validateAuthority=false,
        ~cacheLocation=`localStorage,
        (),
      );

    Js.log(authApp |> Msal.logger |> Msal.correlationId);

About

Bucklescript/ReasonML bindings for https://www.npmjs.com/package/msal (Microsoft Authentication Library Preview for JavaScript)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages