Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving error after changing app to https #53

Open
JaeTLDR opened this issue May 25, 2022 · 1 comment
Open

Receiving error after changing app to https #53

JaeTLDR opened this issue May 25, 2022 · 1 comment

Comments

@JaeTLDR
Copy link

JaeTLDR commented May 25, 2022

I have been using this library successfully with a website running locally on http, I have now updated my redirecturi (et al) to use https, as well as vue cli to https, and I get the following error:

{
    "error": {
        "code": "InvalidAuthenticationToken",
        "message": "CompactToken parsing failed with error code: 80049217",
        "innerError": {
            "date": "2022-05-25T01:13:55",
            "request-id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "client-request-id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        }
    }
}

This was working without issue before switching to https. (redirecturl in AAD being http://localhost:8080/signedin => https://localhost:8080/signedin), and occurs on new browsers, clearing localstorage and cookies, and incognito.

my msal config:

import msal from "vue-msal"
Vue.use(msal, {
  auth: {
    clientId: C.AADappDetails.clientId,
    authority: `https://login.microsoftonline.com/${C.AADappDetails.tenant}/`,
    redirectUri: C.AADappDetails.redirectUri,
    postLogoutRedirectUri: C.AADappDetails.logoutRedirectUri,
    requireAuthOnInitialize: true,
    beforeSignOut:()=>{
      store.commit("auth/resetState")
      console.log("signout")
    },
    onToken:()=>{
        //todo, update vuex
         console.log("ontoken")
    }
  },
  request:{
    scopes: C.AADappDetails.scopes
  },
  framework:{
    globalMixin: true
  },
  graph: {
    callAfterInit: true,
    endpoints: {
      groups: '/me/transitiveMemberOf/microsoft.graph.group?$count=true&$select=id',
      profile: '/me',
      photo: { url: '/me/photo/$value', responseType: 'blob', force: true }
    }
  }
});

and my vue.config.js

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    https: true,
    host: 'localhost',
    port: 8080,
    http2: true, 
    liveReload: true, 
  }
})

Thanks ,
J

@JaeTLDR
Copy link
Author

JaeTLDR commented May 27, 2022

It appears the azure authentication is working but MSAL using the returned tokens are giving me 401's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant