# Vuejs and spring- header issue

**URL:** <https://devforum.okta.com/t/vuejs-and-spring-header-issue/12210>\
**Category:** Questions\
**Tags:** spring, vue\
**Created:** [December 18, 2020, 7:42pm UTC](https://devforum.okta.com/t/vuejs-and-spring-header-issue/12210 "2020-12-18T19:42:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![romanb](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@romanb](https://devforum.okta.com/u/romanb)\
**Post date:** [December 18, 2020, 7:42pm UTC](https://devforum.okta.com/t/vuejs-and-spring-header-issue/12210/1 "2020-12-18T19:42:05Z")

</div>

Hi, I am trying to call a protected endpoint and using the access token to authenticate and I am now receiving this error, couldn’t find much info on it, can anyone point me in the right direction as to what the issue could be?

WWW-Authenticate:  
Bearer error=“invalid\_token”, error\_description=“Bearer token is malformed”, error\_uri=“[https://tools.ietf.org/html/rfc6750#section-3.1](https://tools.ietf.org/html/rfc6750#section-3.1)”

Also here is my axios call

```
  axios
    .get(rootURL + "/rest/stuff/selectAll", {
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${this.$auth.getAccessToken()}`
      }
    })

```

Am I using the access token correctly?

---

<div class="post-metadata">

**Author:** ![romanb](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@romanb](https://devforum.okta.com/u/romanb)\
**Post date:** [December 20, 2020, 9:11pm UTC](https://devforum.okta.com/t/vuejs-and-spring-header-issue/12210/2 "2020-12-20T21:11:47Z")

</div>

I’ve made some progress with this. I have decided to follow this sample from okta ([https://github.com/okta/samples-js-vue/tree/master/okta-hosted-login](https://github.com/okta/samples-js-vue/tree/master/okta-hosted-login))

After logging in I am redirected back but get a 500 error, after starting the spring backend server it changes to 404. Any ideas on where to start to diagnose and where to go from here?

Thanks

---

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://devforum.okta.com/u/warren)\
**Post date:** [December 29, 2020, 6:07pm UTC](https://devforum.okta.com/t/vuejs-and-spring-header-issue/12210/3 "2020-12-29T18:07:11Z")

</div>

If you are running the sample app and click on Messages tab after you have logged in successfully, it should send a request to `localhost:8000/api/messages`. Is your spring backend server configured to receive requests for that endpoint?

> <https://github.com/okta/samples-js-vue/blob/master/okta-hosted-login/src/components/Messages.vue#L38-L39>

---

<div class="post-metadata">

**Author:** ![romanb](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@romanb](https://devforum.okta.com/u/romanb)\
**Post date:** [December 29, 2020, 8:57pm UTC](https://devforum.okta.com/t/vuejs-and-spring-header-issue/12210/4 "2020-12-29T20:57:57Z")

</div>

Hi, thanks for the reply, we have manged to solve the issue and are progressing with the integration. The documentation seems to be pretty good.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 19, 2024, 12:39am UTC](https://devforum.okta.com/t/vuejs-and-spring-header-issue/12210/5 "2024-01-19T00:39:45Z")

</div>


