adal-angular4-example | Angular 4 ADAL Wrapper Example | Command Line Interface library
kandi X-RAY | adal-angular4-example Summary
kandi X-RAY | adal-angular4-example Summary
npm install --save @angular/material @angular/cdk. npm install --save @angular/animations. import {BrowserAnimationsModule} from '@angular/platform-browser/animations';. @NgModule({ ... imports: [BrowserAnimationsModule], ... }). npm install --save hammerjs. ng g module Material. ng g component Toolbar. ng g component Home ng g component NotFound. npm install --save adal-angular4@latest.
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 adal-angular4-example
adal-angular4-example Key Features
adal-angular4-example Examples and Code Snippets
Community Discussions
Trending Discussions on adal-angular4-example
QUESTION
I have built a simple angular app and for authentication, I authenticate against AzureAD using use the npm package adal-angular4
When authentication happens, the user gets sent to https://login.microsoftonline.com
they login and get sent back to the agulare app which causes a reload/recompile which will cause a load time delay, only short but the overall load time experience is doubled.
As you can see above :
- login is loaded (localhost)
- app is compiled
- user taken to login screen (azuread)
- user logs in and user is taken back to login (localhost)
- app is complied
The load gap between main.bundle.js
and background'
is a simple way to show the compile time, its only a VERY TIME but I have a VERY FAST PC.
What can be done to avoid the recompile? My thoughts are
- Do all the auth in the index.html (eg, pre first load of APP) and just save the JWT token to the session storage
- Find an angular packages do this via an IFRAME
Anyone got any thoughts on this? maybe adal-angular4
should use an IFRAME?
Some more details
Example of adal-angular4
Microsofts anglurejs example which uses this javascrit maybe this is a good starting place for a pure JavaScript solutoon thats executed from the index.html.
...ANSWER
Answered 2017-Jul-03 at 07:01Based on my understanding, this is not able to avoid. When the app interact with Azure AD via the Oauth protocol, the flow is like below:
- users click start login-in progress from app
- the app was redirected to the identity data provider(Azure AD)
- users enter the username/password
- the identity data provider response with the 302 redirection to the app
Do all the auth in the index.html (eg, pre first load of APP) and just save the JWT token to the session storage
No, as see the progress in the steps above the authentication has two steps. First is authentication with Azure AD, then the web app authenticate the users with the id_token issued by Azure AD.
More detail about the Oauth 2.0, you can refer the link below:
QUESTION
Im using this https://github.com/benbaran/adal-angular4-example in my Angular app.
When I use the token from this to access Microsoft Graph API I get the following response
...ANSWER
Answered 2017-Aug-29 at 02:12There are several Angular examples available on GitHub: https://github.com/search?q=angular+sample+user:microsoftgraph&type=Repositories
The error you're getting here could have a number of root causes. One common reason for this error is mixing the v1 and v2 endpoint. Another would be failing to request the proper resource when obtaining the token. To debug the cause I would need to understand a bit more such as where you registered your application, which scopes you requested and which calls you were making into Graph.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install adal-angular4-example
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