does couchbase syncgateway support login with access_token instead of id_token?

87 Views Asked by At

I have a pair of questions:

  1. Does syncgateway support login with access token instead of idtoken
  2. Does syncgateway support defined roles in a token?
1

There are 1 best solutions below

0
On

Does Sync Gateway support login with access token instead of ID Token?

No. Sync Gateway only supports ID Token for OpenID Connect Authentication. ID tokens are JSON web tokens (JWTs). Each token contains information for the intended audience (which is usually the recipient). According to the OpenID Connect specification, the audience of the ID token (indicated by the aud claim) must be the client ID of the application making the authentication request. If this is not the case, you should not trust the token. In general, it is not preferable to use Access tokens for authentication because Access tokens cannot tell if the user has authenticated.

Does Sync Gateway support defined roles in a token?

No. Sync Gateway doesn’t support roles to be defined in the authentication token. Roles have a separate namespace from users; it is generally recommended to use the Admin REST API for assigning roles to users.

If you are interested in knowing more about authentication and roles, here is the official documentation:

  1. Users and Roles
  2. Authentication