# Authorization for the nuxt frontend

**URL:** <https://sirix.discourse.group/t/authorization-for-the-nuxt-frontend/47>\
**Category:** Uncategorized\
**Created:** [November 19, 2019, 7:19pm UTC](https://sirix.discourse.group/t/authorization-for-the-nuxt-frontend/47 "2019-11-19T19:19:31Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![mosheduminer](https://yyz2.discourse-cdn.com/free1/user_avatar/sirix.discourse.group/mosheduminer/32/22_2.png) [@mosheduminer](https://sirix.discourse.group/u/mosheduminer)\
**Post date:** [November 20, 2019, 8:52pm UTC](https://sirix.discourse.group/t/authorization-for-the-nuxt-frontend/47/8 "2019-11-20T20:52:51Z")

</div>

On another note, it turns out that we don’t need a whole new scheme - we can just replace this:

```auto
@Component
export default class Login extends Vue {
  private login(): void {
    this.$auth.loginWith('keycloak')   
  }
}

```

with this:

```auto
export default class Login extends Vue {
  private login(): void {
    this.$auth.loginWith('keycloak', {params: {client_id: process.env.client_id, client_secret: process.env.client_secret} }) 
  }
}

```

and the nuxt configuration:

```auto
auth: {
    strategies: {
      keycloak: {
	_scheme: 'oauth2',
	authorization_endpoint: 'auth/realms/sirixdb/protocol/openid-connect/auth',
	userinfo_endpoint: false,
	access_type: 'offline',
	access_token_endpoint: '/auth/realms/sirixdb/protocol/openid-connect/token',
	response_type: 'code',
	token_type: 'Bearer',
  token_key: 'access_token',
      },
    },
    redirect: {
      login: '/login',
      callback: '/callback',
      home: '/'
    },
  },
  env: {
    client_id: 'sirix',
    client_secret: 'ab00e459-3196-4110-923b-e58d71bd4c88'
  },
  router: {
    middleware: ['auth']
  },
  proxy: {
    '/auth/': {
      target: 'http://localhost:8080',
      pathRewrite: {'^/api/': ''}
    }
  }

```

And it seems to work, until I get a  
`We're sorry... An error occurred, please login again through your application.`  
from the /auth/realms/sirixdb/login-actions/authenticate endpoint. I’m stuck on that.

---

_[View the full topic](https://sirix.discourse.group/t/authorization-for-the-nuxt-frontend/47)._
