msal-angular | Angular MSAL Wrapper Module
kandi X-RAY | msal-angular Summary
kandi X-RAY | msal-angular Summary
Angular MSAL Wrapper Module
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of msal-angular
msal-angular Key Features
msal-angular Examples and Code Snippets
Community Discussions
Trending Discussions on msal-angular
QUESTION
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:16To Create injection token you have to instantiate
QUESTION
I'm implementing msal
in my angular application and I'm using msal-v1
library.
I have taken angular-7
sample from the documented samples and tried implementing the below code in my enterprise application.
I have added popup as false
in app.module.ts
ANSWER
Answered 2022-Mar-30 at 05:11I have discussed the same issue in the github(msal-v1
) forum and have found a alternate solution by setting a new route without the MsalGuard
but to the same HomeComponent
.
QUESTION
I am on Angular 13, integrated with Azure AD using MSAL. My issue is as soon as the user successfully logs in , the logincomponent is not displayed. But when I do a page refresh then the login component displays. How do I get login component to display as soon as the user signs in.
On debugging realized, on signing in when AuthGaurd kicks in , this this.msalsvc.instance.getActiveAccount() returns a null even though sign in was successful
This is my app routing,
...ANSWER
Answered 2022-Feb-03 at 08:02After calling login()
, and ensuring it completes successfully, navigate to the correct path using the Router
service. This will cause the auth guard to fire after logging in.
In order to ensure login completed, you should return the observable created in the login()
function.
In common.service.ts:
QUESTION
I'm having an odd error logging my app into B2C using auth code flow with PKCE using the @azure/msal-angular library. I'm redirecting back to the B2C login, get redirected back to my app, my app successfully gets a token back from the token api but then a JS error is logged and prevents my app from continuing to load. Here is the console output:
...ANSWER
Answered 2022-Feb-01 at 19:34The solution to this was for me to add the
QUESTION
I'm trying to move an existing angular 9 app from using an implicit flow with azure B2C to using the new auth code grant flow with PKCE. I'm using the @azure/msal-angular package and almost have it working. Just waiting on our identity management team to enable some settings.
But I'm wondering if this package automatically refreshes the bear token with the refresh token that we get in the token response? Or do I have to do some manual magic to get the refresh to happen? I'm not finding anything in this package's documentation pertaining to refresh tokens, wondering if anybody out there is using this and knows what the default behavior is with this package as it pertains to the use of the refresh token.
...ANSWER
Answered 2022-Jan-26 at 08:38Yes, it automatically handles the token refresh.
From the (Microsoft Documentation):
Acquiring tokens silently (from the cache)
MSAL maintains a token cache (or two caches for confidential client applications) and caches a token after it's been acquired. In many cases, attempting to silently get a token will acquire another token with more scopes based on a token in the cache. It's also capable of refreshing a token when it's getting close to expiration (as the token cache also contains a refresh token).
QUESTION
I am Trying to make a shared download as pdf method in my service file. But when i try to call my method in my app component it gives 'Cannot read properties of undefined (reading 'nativeElement')' error. The Download method works perfectly when I call it directly in my app component. #here is my download.service.ts#
...ANSWER
Answered 2022-Jan-14 at 22:18I would suggest to remove the ViewChild located inside your service and to add an addtional parameter to your downlodpdf method of type ElementRef. So you could pass necessarry ElementRefs to the service directly.
@ViewChild is only supported for classes decorated with @Component or @Directive. You can read more inside the angular @ViewChild documentation.
download.service.ts
QUESTION
i am getting this error and i am stuck cant find where is the syntax problem
...core.mjs:6495 ERROR SyntaxError: Invalid regular expression: /https://graph.microsoft.com/v1.0/communications/callRecords/getPstnCalls(fromDateTime=2020-01-30,toDateTime=2020-01-30/: Unterminated group at new RegExp () at Function.StringUtils.matchPattern (StringUtils.js:122) at azure-msal-angular.js:425 at Array.forEach () at MsalInterceptor.matchResourcesToEndpoint (azure-msal-angular.js:422) at MsalInterceptor.getScopesForEndpoint (azure-msal-angular.js:404) at MsalInterceptor.intercept (azure-msal-angular.js:336) at HttpInterceptorHandler.handle (http.mjs:1415) at HttpXsrfInterceptor.intercept (http.mjs:2018) at HttpInterceptorHandler.handle (http.mjs:1415)
ANSWER
Answered 2021-Nov-28 at 14:19You have missed to close the parentheses in the queryUrl value. To correct this, your queryUrl value must be like:
QUESTION
Azure's AD B2C keeps issuing v1 tokens even though v2 tokens are configured in the manifest of the SPA app that's registered:
...ANSWER
Answered 2021-Nov-24 at 12:32Azure AD B2C only ever used the endpoint when making the OIDC Authentication requests with v2.0, a v1.0 never existed. So it always has issued v1.0 tokens (v2 is the first and only version). This is completely normal.
Only Azure AD had v1.0 and v2.0 OIDC endpoint, and therefore maps based off of accessTokenAcceptedVersion
.
You don't need to mess with this property in AAD B2C application registrations unless you have a SAML relying party.
QUESTION
I built an angular application and I wanted to let users connect to it only via microsoft account using @azure/msal-angular and @azure/msal-browser packages.
I created a component to handle the connection called login
this is login.component.ts
...ANSWER
Answered 2021-Nov-19 at 14:17export function MSALInstanceFactory(): IPublicClientApplication {
return new PublicClientApplication({
auth: {
clientId: '0d6bd648-96d2-451b-9b06-5e087ec9a11c', // Application (iSell+) id
// I had to put it that way, not just the tenantID
authority: 'https://login.microsoftonline.com/tenantID', // Directory (tenant) id
redirectUri: 'http://localhost:4200', // Need to be changed when in production
// clientId: 'de55bfa3-1bc6-450a-b2b6-83b38186af92',
// redirectUri: 'http://localhost:4200',
}
})
}
QUESTION
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:25For 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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install msal-angular
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page