mvertopoulos / vue-msal

Vue plugin for using Microsoft Authentication Library (MSAL)
MIT License
123 stars 66 forks source link

the idToken property of both $msal.data and the mixin's data object are an empty string #36

Closed julius-kamp closed 4 years ago

julius-kamp commented 4 years ago

Expected Behavior

The idToken property of both $msal.data and the msal mixin's data object should both be the correct id token.

Current Behavior

The idToken property of both $msal.data and the msal mixin's data object are both an empty string. However the id token is present in the browses local storage.

Steps to Reproduce

  1. create a new vue project
  2. add vue-msal
  3. use the plugin in a vue component using the clientId, authority and redirectUri of a registered application
  4. add a function to signIn
  5. output $msal.data and the msal mixin's data object; check the browsers local storage

    Context

    I would like to use the id token as verification for connecting to my api. I do not want to get it directly out of the local storage, as the key name seams to be not consistent.

julius-kamp commented 4 years ago

The problem was that access tokens was not selected on the Microsoft App registration page. Apparently it is necessary to select both access tokens and id tokens, even if you are only interested in the id token. The relevant settings are on App registration > Authentication page on the middle of the page.