1
votes

I want to authenticate users with Google Cloud Endpoint via cookie that includes JWT token, because I want to server-side-render pages depending on whether an user is authenticated or not.

According to official docs, Cloud Endpoint seems to support authentication via Authorization header and query parameter in URL. But it is almost impossible or inconvenient for users to add authorization header or query parameters by themselves. Thus when users access a page, they will get a page for unauthenticated users even when they are logged in.

So does Cloud Endpoint support authentication via cookie?

1
Which configuration are you using ? Java + App Engine ? I don't remember if there's anything native, but you can create a custom Authenticator that creates the User object based on your logic. Just have a look at the classes that extend Authenticator to have an idea - Pievis
I am using NodeJS + Cloud Run. According to @guillaume, authentication by custom cookie is not supported. - hitochan

1 Answers

2
votes

According with this page, the custom authentication is based on OAuth2 (OIDC) and a JWT token must be sent for performing the authentication

You can use other authentication platforms to authenticate users as long as it conforms to the JSON Web Token RFC 7519.

The authentication by custom cookies isn't supported. However, Cloud Endpoint (ESP) has been open sourced earlier this year and you can contribute to the project if you want this feature; or at least create a feature request