# 500 internal server error / server\_error: Unable to issue redirect for OAuth 2.0 transaction

**URL:** <https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [December 16, 2023, 1:43pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201 "2023-12-16T13:43:27Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![hzhao1003](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hzhao1003/32/53310_2.png) [@hzhao1003](https://community.auth0.com/u/hzhao1003)\
**Post date:** [December 16, 2023, 1:43pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/1 "2023-12-16T13:43:27Z")

</div>

I was able to open the login page but once I use my credentials to login, it gave me 500 internal server error in the console. I checked my redirect\_uri and I tried to put my localhost directly but it wont work…The issue in my log said **server\_error** : Unable to issue redirect for OAuth 2.0 transaction. The web application uses Vue2 and auth0-spa-js 1.22.5. I tried to update the auth0-spa-js version but there was some compatible issues so I sticked to the older version.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 22, 2023, 4:04pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/3 "2023-12-22T16:04:01Z")

</div>

Hi @hzhao1003,

Welcome to the Auth0 Community!

I can’t see the image you’ve attached because it is a link from a private source.

What request is returning the error? You can see the requests in your DevTools _Network_ tab.

Let me know!

---

<div class="post-metadata">

**Author:** ![hzhao1003](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hzhao1003/32/53310_2.png) [@hzhao1003](https://community.auth0.com/u/hzhao1003)\
**Post date:** [December 29, 2023, 8:23pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/4 "2023-12-29T20:23:54Z")

</div>

Hi Dan,

thank you so much for the reply, I tried to login, but once I clicked the continue button I received the 500 internal error and hope this image will show😂. I use vue2 and auth0-spa-js if that helps.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/0/e/0e8822859dbaaaf3ae1e731eaba10dcf9304746d.png)  
and here is what I got in the console  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/b/7/b74491432530564d4188839fa5195b0f29505eba.png)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 4, 2024, 6:07pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/5 "2024-01-04T18:07:03Z")

</div>

I suspect you may be pointing to the wrong domain. Can you confirm you are copying the domain property directly from the Application Settings in the dashboard?

---

<div class="post-metadata">

**Author:** ![hzhao1003](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hzhao1003/32/53310_2.png) [@hzhao1003](https://community.auth0.com/u/hzhao1003)\
**Post date:** [January 4, 2024, 6:40pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/6 "2024-01-04T18:40:50Z")

</div>

Hi Dan,

I just checked my dashboard and copied domain again to my code. It still gave me the same error…

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 5, 2024, 5:03pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/7 "2024-01-05T17:03:54Z")

</div>

Can you please share the details of how you are making the request? A code snippet would be helpful.

---

<div class="post-metadata">

**Author:** ![hzhao1003](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hzhao1003/32/53310_2.png) [@hzhao1003](https://community.auth0.com/u/hzhao1003)\
**Post date:** [January 11, 2024, 12:34am UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/8 "2024-01-11T00:34:51Z")

</div>

1. In auth0-plugin.js file:

```auto
import Vue from 'vue'
import createAuth0Client from '@auth0/auth0-spa-js'

/**
 * Vue.js Instance Definition
 */

let instance

export const getInstance = () => instance

/**
 * Vue.js Instance Initialization
 */

export const useAuth0 = ({
  onRedirectCallback = () =>
    window.history.replaceState({}, document.title, window.location.pathname),
  redirectUri = window.location.origin,
  // this ...options is for passing domain and client ID that saved in auth_config.json
  ...options
}) => {
  if (instance) return instance

  instance = new Vue({
    data() {
      return {
        auth0Client: null,
        isLoading: true,
        isAuthenticated: false,
        user: {},
        error: null
      }
    },

    async created() {
      this.auth0Client = await createAuth0Client({
        ...options,
        domain: options.domain,
        client_id: options.clientId,
        authorizationParams: {
          redirect_uri: redirectUri
        }
      })

      try {
        if (
          window.location.search.includes('code=') &&
          window.location.search.includes('state=')
        ) {
          const { appState } = await this.auth0Client.handleRedirectCallback()

          onRedirectCallback(appState)
        }
      } catch (error) {
        this.error = error
      } finally {
        this.isAuthenticated = await this.auth0Client.isAuthenticated()
        this.user = await this.auth0Client.getUser()
        this.isLoading = false
      }
    },
    methods: {
      async handleRedirectCallback() {
        this.isLoading = true
        try {
          await this.auth0Client.handleRedirectCallback()
          this.user = await this.auth0Client.getUser()
          this.isAuthenticated = true
        } catch (error) {
          this.error = error
        } finally {
          this.isLoading = false
        }
      },

      loginWithRedirect(options) {
        return this.auth0Client.loginWithRedirect(options)
      },

      logout(options) {
        return this.auth0Client.logout(options)
      },

      getTokenSilently(options) {
        return this.auth0Client.getTokenSilently(options)
      }
    }
  })

  return instance
}

/**
 * Vue.js Plugin Definition
 */

export const Auth0Plugin = {
  install(Vue, options) {
    Vue.prototype.$auth = useAuth0(options)
  }
}

```

1. I have auth\_config.json to store my domain and clientID info
2. In main.js:

```auto
import { domain, clientId } from '../auth_config.json'

Vue.use(Auth0Plugin, {
  domain,
  clientId,
  onRedirectCallback: (appState) => {
    router.push(
      appState && appState.targetUrl
        ? appState.targetUrl
        : window.location.pathname
    )
  }
})

```

1. I have an AuthenticationButton.vue:

```auto
<template>
  <!-- Check that the SDK client is not currently loading before accessing is methods -->
  <div v-if="!$auth.loading">
    <!-- show login when not authenticated -->
    <button v-if="!$auth.isAuthenticated" @click="login">Log in</button>
    <!-- show logout when authenticated -->
    <button v-if="$auth.isAuthenticated" @click="logout">Log out</button>
  </div>
</template>

<script>
export default {
  name: 'AuthenticationButton',
  methods: {
    // Log the user in
    login() {
      this.$auth.loginWithRedirect()
    },
    // Log the user out
    logout() {
      this.$auth.logout({
        logoutParams: {
          returnTo: window.location.origin
        }
      })
    }
  }
}

</script>

```

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 11, 2024, 2:22pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/9 "2024-01-11T14:22:51Z")

</div>

@hzhao1003,

Are you missing imports in your .vue file?

Also, what line is throwing the error?

---

<div class="post-metadata">

**Author:** ![hzhao1003](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hzhao1003/32/53310_2.png) [@hzhao1003](https://community.auth0.com/u/hzhao1003)\
**Post date:** [January 12, 2024, 12:16am UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/10 "2024-01-12T00:16:56Z")

</div>

No line of the codes throw error. but when I ran `npm run dev` and try to login from the web server it wont redirect and showed the error 500.

Do you mean I missed auth0 imports in AuthenticationButton.vue?

Thank you!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 12, 2024, 4:02pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/11 "2024-01-12T16:02:29Z")

</div>

> [@hzhao1003](#):
>
> Do you mean I missed auth0 imports in AuthenticationButton.vue?

Yes, that’s correct.

---

<div class="post-metadata">

**Author:** ![hzhao1003](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hzhao1003/32/53310_2.png) [@hzhao1003](https://community.auth0.com/u/hzhao1003)\
**Post date:** [January 13, 2024, 1:53am UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/12 "2024-01-13T01:53:24Z")

</div>

Hi Dan,

I checked this page: [Vue.js Authentication 2 By Example](https://developer.auth0.com/resources/guides/spa/vue/basic-authentication/v2-javascript?_gl=1*19n7o0*_gcl_aw*R0NMLjE3MDE4NzMxMTAuQ2p3S0NBaUExTUNyQmhBb0Vpd0FDMmQ2NGJ3anJLcFZ2X19xTzVkX0duS3NLMTNlS2FjSGpVcUJxNGZaelY4dzJDdzRBdHJVVE9velVob0NuckVRQXZEX0J3RQ)…_\_gcl\_au_NjAxNDM5NTkwLjE2OTk0OTAwOTI._\_ga_MjAzOTU5NzUzMC4xNzAyNjUxMTAx\*\_ga\_QKMSDV5369\*MTcwNTExMDQ1OC4yMS4wLjE3MDUxMTA0NjUuNTMuMC4w  
and it seems like on the login button I don’t need import anything. Did I miss something 😅

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 16, 2024, 3:16pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/13 "2024-01-16T15:16:19Z")

</div>

I just tested out the quickstart and everything is working. I didn’t need to import either, I think you are correct.

…

Also, I missed something initially that I’m concerned is the root of the problem:

> [@hzhao1003](#):
>
> auth0-spa-js 1.22.5. I tried to update the auth0-spa-js version but there was some compatible issues so I sticked to the older version.

These are major version differences and there are significant, breaking changes between the two versions. I would expect auth0-spa-js v1.x to cause problems if you are following a quickstart for version 2.x.

For what it’s worth, I didn’t have any trouble using `"@auth0/auth0-spa-js": "^2.1.3",` in my application.

---

<div class="post-metadata">

**Author:** ![hzhao1003](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hzhao1003/32/53310_2.png) [@hzhao1003](https://community.auth0.com/u/hzhao1003)\
**Post date:** [January 16, 2024, 3:31pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/14 "2024-01-16T15:31:32Z")

</div>

I see. Thank you Dan! I’ve actually used the 2.1.3 version and with that version I couldn’t even get to the login page but with the older version I can open the login page, it’s just after submit the credentials it won’t redirect…I will ask my manager to update the version and try again!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 16, 2024, 5:54pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/15 "2024-01-16T17:54:55Z")

</div>

Sounds good. Let me know what you’re seeing with the new version.

If you _absolutely must use V1_, here are the changes that you’ll need to adapt from the quickstart.

> <https://github.com/auth0/auth0-spa-js/blob/9d75a6c9d286f0faacbf21b385fb5e5e6bee2efe/CHANGELOG.md?plain=1#L102>

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 30, 2024, 5:55pm UTC](https://community.auth0.com/t/500-internal-server-error-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/123201/16 "2024-01-30T17:55:34Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
