Giter Club home page Giter Club logo

Comments (10)

jcmontx avatar jcmontx commented on September 15, 2024 6

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.

ringodotnl avatar ringodotnl commented on September 15, 2024 1

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.

grumar avatar grumar commented on September 15, 2024

It is working example. Please create a plunker or attach Your code.

from adal-angular5.

jcmontx avatar jcmontx commented on September 15, 2024

I mean, a client angular 5 app using the library

from adal-angular5.

nybroe avatar nybroe commented on September 15, 2024

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.

nybroe avatar nybroe commented on September 15, 2024

Just tried it out - works perfect - thanks @jcmontx !!

from adal-angular5.

nybroe avatar nybroe commented on September 15, 2024

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:

  1. Initial login using "login()"
  2. 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.

AlexeyBoiko avatar AlexeyBoiko commented on September 15, 2024

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.

pvsherman avatar pvsherman commented on September 15, 2024

@jcmontx Example works fine. Thank you.

from adal-angular5.

grumar avatar grumar commented on September 15, 2024

Thank You @jcmontx I copied Your example.

from adal-angular5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.