Comments (10)
I finally got this to work. Here's a full example 😄. Remember to put your tenant and clientId.
Feel free to add it to the docs.
from adal-angular5.
Thx jcmontx, a full example with aquiretoken would be nice, you have any Grumar ?
I my currently example when you login the first time it seems to load the example app like 3 times when uising aquiretoken to the app, after login at the AD.
Might be due a issue at handleWindowCallback not sure.
Cheers.
from adal-angular5.
It is working example. Please create a plunker or attach Your code.
from adal-angular5.
I mean, a client angular 5 app using the library
from adal-angular5.
Definitely - bumping up the adal-angular4 example to use this version aint that easy - I am on my 2nd hour of creating this "simple" example and I keep running into different issues.
A working example without needing to bump up from an earlier example would be great!
from adal-angular5.
Just tried it out - works perfect - thanks @jcmontx !!
from adal-angular5.
So a couple of questions:
1)
I have also tried to add the use of acquireToken in @jcmontx 's example and was able to retrieve the access_token (not the id_token).
I might be misunderstanding the use of adal.js but in order to get the actual access_token and thereby getting the appRoles (which is not included in the id_token), I need to login in first - getting the id_token and then afterwards getting the access_token using acquireToken?
Is there a way to retrieve the access_token without having to log in?
2)
My flow currently looks like this:
- Initial login using "login()"
- retrieving access_token using acquireToken() by setting the resource parameter to the application resourceURI and not the clientId. Using the clientId as the resource parameter just retrieves the id_token from the cache.
The only drawback using the flow above is that the state upon callback is not the same as the expected state and the state is set to false, given an errormessage. When the state is not valid the handleWindowCallback() fails to update the sessionCache and the access_token in the cache remains the same as the id_token... For now I am not using handleWindowCallback and manually updating the sessionCache but I would like to avoid any manual "hacks".
Am I using it wrong or is this a bug?
from adal-angular5.
Thank you for the library. @jcmontx example is useful, but did not show how to use token.
I can successfully get userInfo after login (it is shown in example). But when I try to call Microsoft Graph API I get not authorized exception.
Could you please provide a full example with calling Microsoft Graph API or other Office 365 API.
Here is my example of using Microsoft Graph API, without adal-angular5. There @types/adal is used.
from adal-angular5.
@jcmontx Example works fine. Thank you.
from adal-angular5.
Thank You @jcmontx I copied Your example.
from adal-angular5.
Related Issues (20)
- Write unit tests: HOT 1
- use @typings for adal-angular HOT 3
- cherry pick [benbran#23](https://github.com/benbaran/adal-angular4/pull/23) HOT 1
- BUG: Cannot call Microsoft Graph using adal-angular5 HOT 1
- Use version 2.1.1 HOT 1
- handleWindowCallback refreshing page HOT 1
- Fancy doing an angular6 one? HOT 1
- No way to handle interaction_required adal errors
- Post Angular 6 and rxjs Upgrade throws runtime error. HOT 8
- Access token Expiry - 401 Unauthorized on AJAX HOT 2
- Authorization to WEB API HOT 6
- [Bug] Acquire token ( Refresh token ) not working
- Error when first time acquire access token for resource HOT 3
- Http Interceptor does not account for resource specific tokens HOT 1
- how to update new token when generated token has expired
- Token is null & authenication is false
- ng-init calling 2 times big issue
- Multi Issue in aquiretoken function. The function works fine if the token is in local storage. But when you will remove the storage and invoke the acquiretoken function it will not get inside the subscribe block. and more over that its getting invoked only once
- Multiple issues in Version 2.1.1 HOT 1
- Does adal-angular 5 supports in angular 7? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adal-angular5.