microsoft-authentication-library-for-js | Microsoft Authentication Library for JS | Azure library

 by   AzureAD TypeScript Version: msal-angular-v2.5.8 License: MIT

kandi X-RAY | microsoft-authentication-library-for-js Summary

kandi X-RAY | microsoft-authentication-library-for-js Summary

microsoft-authentication-library-for-js is a TypeScript library typically used in Cloud, Azure applications. microsoft-authentication-library-for-js has a Permissive License and it has medium support. However microsoft-authentication-library-for-js has 22 bugs and it has 1 vulnerabilities. You can download it from GitHub.

Microsoft Authentication Library (MSAL) for JS
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              microsoft-authentication-library-for-js has a medium active ecosystem.
              It has 3062 star(s) with 2504 fork(s). There are 131 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 81 open issues and 3044 have been closed. On average issues are closed in 73 days. There are 14 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of microsoft-authentication-library-for-js is msal-angular-v2.5.8

            kandi-Quality Quality

              microsoft-authentication-library-for-js has 22 bugs (0 blocker, 0 critical, 13 major, 9 minor) and 8 code smells.

            kandi-Security Security

              microsoft-authentication-library-for-js has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              microsoft-authentication-library-for-js code analysis shows 1 unresolved vulnerabilities (0 blocker, 0 critical, 1 major, 0 minor).
              There are 25 security hotspots that need review.

            kandi-License License

              microsoft-authentication-library-for-js is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              microsoft-authentication-library-for-js releases are available to install and integrate.
              It has 14250 lines of code, 22 functions and 1378 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of microsoft-authentication-library-for-js
            Get all kandi verified functions for this library.

            microsoft-authentication-library-for-js Key Features

            No Key Features are available at this moment for microsoft-authentication-library-for-js.

            microsoft-authentication-library-for-js Examples and Code Snippets

            No Code Snippets are available at this moment for microsoft-authentication-library-for-js.

            Community Discussions

            QUESTION

            Declared InjectionToken cannot be found on compile of Angular application
            Asked 2022-Apr-08 at 03:16

            Im trying to provide a global configuration, which is dependent on the user's webbrowser, by using an InjectionToken. However the declared const cannot be found in the source code on compiling the application. I have seen this pattern work before(1), but I am not sure what I am doing differently. Below is an abstract of my code.

            ...

            ANSWER

            Answered 2022-Apr-08 at 03:16

            To Create injection token you have to instantiate

            Source https://stackoverflow.com/questions/71791122

            QUESTION

            Does MSAL.js support the check_session_iframe OIDC endpoint?
            Asked 2022-Feb-09 at 23:32

            I'm working on an SPA which depends on an instance of Identity Server for authenticating users. I need a solution that manages my tokens locally, but Duende (the owners of Identity Server) lean towards a Backend For Frontend (BFF) pattern over Javascript libraries. This isn't going to work for us. Since the original oidc-client that was written by the authors of Identity Server is no longer maintained I've been looking at Javascript alternatives. The most likely candidate would seem to be Microsoft's MSAL.js which is built for Azure AD, but supposedly supports OIDC standards.

            From what I can tell, MSAL.js forces you down an offline_access path using refresh tokens to renew security tokens. Even if I don't expressly require an offline_access scope the library appends one anyway! But my use case doesn't require refresh tokens. Instead I want my client to keep the session on the identity provider fresh using OIDC session mamnagement standards (via the check_session_iframe endpoint exposed by the provider's well-known JSON).

            I have found that if I ignore the offline_access scope requested by the MSAL.js library so my identity provider only issues and ID token and an access token then MSAL continues to work just fine. It even has an ssoSilent option for explicitly renewing the tokens via a connect/authorize request in a hidden iframe. But as far as I can tell I can't have the library keeping that session fresh via an iframe like the old oidc-client used to.

            So given that session management is part of the OIDC specification, and MSAL is supposed to be an OIDC-compliant library, am I missing something here?

            ...

            ANSWER

            Answered 2022-Feb-09 at 23:32

            Unfortunately, at this time MSAL.js does not have an API that integrates with the checksession endpoint. If you would like to see this added, you are welcome to open a PR on our Github.

            Source https://stackoverflow.com/questions/71019860

            QUESTION

            What is the structure of the config file for Azure B2C Authetication using react app along with the Authority link structure?
            Asked 2022-Jan-13 at 18:14

            I am trying to get the perfect structure of config and the authority url for my B2C auth application that will be integrated with Azure and React. I did get this structure for my config file and the auth link is specified as in the comments. but I am not able to get the popup screen and the error says that the authority link is invalid.

            ...

            ANSWER

            Answered 2022-Jan-13 at 18:14

            Here is an example authority URL, as per the guide here:
            authority: "https://contoso.b2clogin.com/contoso.onmicrosoft.com/Your-B2C-SignInOrSignUp-Policy-Id"

            Your code has:
            const tenantName = "TenantName";
            const signInPolicy = "Plicy_For_SignIn";
            const AuthorityUrl = https://${tenantName}/tfp/${tenantName}/${signInPolicy}

            Which results into: https://TenantName/tfp/TenantName/Plicy_For_SignIn -> that does not conform to the sample.

            You need to make it follow this format:
            authority: "https://contoso.b2clogin.com/contoso.onmicrosoft.com/Your-B2C-SignInOrSignUp-Policy-Id"

            As follows: const AuthorityUrl = https://${tenantName}.b2clogin.com/tfp/${tenantName}.onmicrosoft.com/${signInPolicy}

            Source https://stackoverflow.com/questions/70687555

            QUESTION

            AAD B2C Authentication for Dockerized Azure Function App
            Asked 2022-Jan-13 at 12:01

            We are currently successfully running a Node.js Azure Function App deployed in an App Service in Azure with AAD B2C authentication as backend for a React-based Single-Page Application. User authentication in the SPA is done with Azure AAD B2C, where users obtain a JWT Token which is used as Bearer token for all requests against the backend API. This works great.

            Due to different reasons, we now need to dockerize our Function App and move it inside a Kubernetes cluster. This prevents us from using the AAD B2C integration of the Function App in the App Service for protecting the API, hence we need a different approach to validate the Bearer tokens of the requests.

            From what we understand, there are two possible options to do this:

            1. passport.js
            2. MSAL

            passport.js seems to work great for all Express-based apps and is therefore not suitable for us as our Function App is not Express-based. We also had a look at msal-node and various examples using it, but struggle to understand exactly where and how our token validation fits and which (if any) of the examples fits our use case.

            Are we looking in the right direction with msal-node and if so, how can we accomplish the task of protecting a containerized Node.js Azure Function App by validating the Bearer token with the AAD B2C?

            ...

            ANSWER

            Answered 2022-Jan-13 at 12:01

            We found a working solution. Turns out we were thinking way too complicated and "normal" JWT verification is exactly what we needed to do.

            This StackOverflow post describes exactly what we were trying to achieve.

            Source https://stackoverflow.com/questions/70685363

            QUESTION

            Sign Out Of All Accounts When RedirectURI returns to guarded application
            Asked 2022-Jan-07 at 20:31

            I am using MSALjs to logout a user on my application. When the msalService.logoutRedirect() is triggered, the page redirects and is logged out. However, my application does not have an "un-guarded" route, thus the redirect after logout (postLogoutRedirectUri) is set to return to the application's last active page. And when it returns to the application, the MSAL guard automatically finds a valid MS session and logs back in again automatically (after redirects).

            If I change the postLogoutRedirectUri to https://login.microsoftonline.com/common/oauth2/logout, the logout does work and I am signed out correctly. However, I would like to immediately be prompted to sign back in, which is why I intend on returning to the application so the MsalGuard can prompt sign in.

            Per a recent GitHub issue , one of the MSAL contributors said the following:

            This is a nuance of how B2C works. By default B2C might not log you out of your federated identity provider when you call the logout endpoint, this is explained in more detail here. I unfortunately don't know enough about B2C configuration to give you a definitive answer but you may need to create a custom policy which redirects to the AAD logout endpoint you mentioned: 'https://login.microsoftonline.com/common/oauth2/logout' as this endpoint is the one that ultimately closes your session with AAD. You can also have B2C pass through your postLogoutRedirectUri to this endpoint so that AAD redirects you back to your application after the logout instead of ending on the "Close this window" screen, if desired.

            How can I set this up so the logout is triggered correctly and all sessions are signed out?

            Furthermore, if I manually change the metadata of the openid-config to have the "end_session_endpoint" equal to the microsoftonline logout link from above, the behavior seems to be more in line with what I would expect.

            ...

            ANSWER

            Answered 2022-Jan-07 at 20:31

            You could send the apps post logout redirect uri to the federated IdPs logout url. You can set the postLogoutRedirectURI in MSAL config object.

            And at the federated IdP, set the logout url to the application.

            Approach only works if you are using 1 federated IdP, and is the only IdP available.

            Source https://stackoverflow.com/questions/70626401

            QUESTION

            msal-angularv2.0.4 IE11 not working with promise polyfill
            Asked 2021-Oct-26 at 07:25

            I believe we have everything mentioned in https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/v2-docs/ie-support.md

            We have included a promise polyfill at the top of our index.html:

            ...

            ANSWER

            Answered 2021-Oct-26 at 07:25

            For anyone having similar issues:

            We were using MSAL-angular v2.0.4 with Angular 6. Having downgraded to MSAL-angular v1.4.0, IE11 works fine.

            Source https://stackoverflow.com/questions/69660480

            QUESTION

            Azure ADB2C Single Sign Out W/ Azure AD as Identity Provider
            Asked 2021-Sep-17 at 19:51

            I have a React SPA which uses msal. I have configured Azure AD as Identity Provider for my AADB2C. I can signIn/signOut and other operations.

            If my user signs out off my application, I want to also sign out of my Identity Provider. I looked a bit into this matter 1, 2, 3, 4, 5.

            At this moment, I use msal's logoutRedirect method.

            ...

            ANSWER

            Answered 2021-Sep-17 at 19:51

            You are doing an RP Initiated Logout in OpenID Connect terms, meaning you need to also send the id_token_hint query parameter.

            I can also confirm that sending both query string parameters logs out successfully for my Azure developer account:

            Source https://stackoverflow.com/questions/69222581

            QUESTION

            BrowserAuthError: interaction_in_progress - Unable to fix, regardles of solutions found
            Asked 2021-Aug-19 at 09:34

            I'm implementing security for the applications at the company I'm working at right now. I'm using @azure/msal-angular@2.0.2, @azure/msal-browser@2.16.1. I followed the example found here and got it working for the first application. I went on to implement it for the next application, which is basically the same one, just talks to a different api, but the complexity is the same. After possibly doing something wrong I keep getting the error:

            ...

            ANSWER

            Answered 2021-Aug-19 at 09:34

            "Workaround" fix

            Make your login type Popup. Dumb of me not to think about that

            Source https://stackoverflow.com/questions/68726691

            QUESTION

            How do I know that I already single sign-on in angular application?
            Asked 2021-Aug-11 at 14:49

            I use https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/v2-docs/configuration.md to setup a single sign-on in angular. So if I click the sign in button then I can login.

            My question is that if in other place I already login with my company's credentials so I don't need to login again in the angular application. How my angular application knows I already signed? Therefore I don't need navigation to login component and click sign in button again?

            ...

            ANSWER

            Answered 2021-Aug-11 at 14:49

            The msal-browser library provides the following APIs to access cached accounts:

            • getAllAccounts(): returns all the accounts currently in the cache. An application must choose an account to acquire tokens silently.
            • getAccountByHomeId(): receives a homeAccountId string and returns the matching account from the cache.
            • getAccountByLocalId(): receives a localAccountId string and returns the matching account from the cache.
            • getAccountByUsername(): receives a username string and returns the matching account from the cache.

            [ ... snip ... ]

            The current msal-browser default sample has a working single account scenario.

            Source: Accounts in MSAL Browser.

            Part of that example code:

            Source https://stackoverflow.com/questions/68743757

            QUESTION

            Does MSAL 2.*.js works with IE 11?
            Asked 2021-Jul-15 at 06:51

            I have implemented SPA in the same way as mentioned here - https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-javascript-spa#configure-your-javascript-spa

            I have changed the code as per - https://github.com/Azure-Samples/active-directory-b2c-javascript-msal-singlepageapp/issues/61#issuecomment-630953375

            Still my code is not working IE 11. Only thing which is different from the above code is I am using MSAL 2.13.1.js.

            Does 2.*.js works with IE11 ?

            Code which I have used is below. It doesnt redirect to the Microsoft login page in IE 11. It works fine in chrome and edge.

            ...

            ANSWER

            Answered 2021-Jul-12 at 10:54

            In short: yes. MSAL 2.0 supports IE. It does, however, need a Promise polyfill to do so, which it doesn't include.

            What browsers are supported by MSAL.js?
            MSAL.js has been tested and supports the last 2 stable and supported versions of the following browsers:

            • Chrome
            • Edge (Chromium)
            • Firefox
            • Safari
            • Opera

            MSAL.js has also been tested and supports the following browsers with Promise polyfills (not included):

            • IE 11
            • Edge (Legacy)

            Information taken from the FAQ: What browsers are supported by MSAL.js?

            Source https://stackoverflow.com/questions/68345376

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install microsoft-authentication-library-for-js

            You can download it from GitHub.

            Support

            GitHub Issues is the best place to ask questions, report bugs, and new request features. FAQs for access to our frequently asked questions. Stack Overflow using "msal" and "msal.js" tag.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link