2

I have an angularjs web application that uses Azure Active Directory for authentication. The Web Api that the application uses, authenicates without any errors.

For client-side authentication I am using adal.js and adal-angular.js. When i try to visit any page in my app, authentication fails and prints the following messages in the console

The returned id_token is not parseable.
Route change event for:/
Start login at:https://localhost:44308/#
Navigate url:https://login.windows.net/myapp.onmicrosoft.com/oauth2/authorize
Navigate to:https://login.windows.net/myapp.onmicrosoft.com/oauth2/authorize
TypeError: Cannot read property 'data' of undefined

I have followed this tutorial.

Does anyone know what is going on or how can I debug this?

2 Answers 2

3

The error was in the adal.js library when the token which didn't decode correctly utf-8 characters.

An updated version of the library with the bug fix will be available soon.

Sign up to request clarification or add additional context in comments.

2 Comments

I also encounter the same issue. Are you able to solve this?
Yes, the error in my case was, that the library couldn't decode correctly the greek characters in user names. There was no problem with users without greek characters. This has been fixed for Greek characters. Maybe the user tou are trying to login has a special character in any attribute? (e.g. firstname, lastname...)
1

It's tough to answer without seeing a code sample. If you're using promises, you need to handle the case if the promise is rejected. You probably have something like this:

    myAuthService.authenticate(...).then(function(data){
       //this handles the successful call.
    });

What you need to see the error is something like this:

        myAuthService.authenticate(...).then(function(data){
           //this handles the successful call.
        }, function(e){
           //this handles the error case
           alert('errror.  inspect this.arguments');
});

You should post the code that is throwing the error.

3 Comments

As you can see in the link posted, the only code is the one that initializes the library. There is an event that fires on error but doesn't seem to help...
You will receive better answers if you share code samples rather than sharing links to whatever tutorial you're trying to follow. See the section "Help others reproduce the problem": stackoverflow.com/help/how-to-ask
The problem seems to be a bug in the library... I fixed this and works fine! Thanks anyway

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.