Live data from Hacker News

Ask HN: What is the best way to add authentication to REST API (for mobile)?

news.ycombinator.com

1–10 of 23 posts

Ask HN: What is the best way to add authentication to REST API (for mobile)?

#1
Newbie Question: What is a secure and accepted way for authentication and authorisation of REST API endpoint for mobile and SPA's? A google search usually yields JWT but from what I know about JWT, it's complex and doesn't support revocation of tokens easily.

Re: Ask HN: What is the best way to add authentication to REST API (for mobile)?

#7
post #2

An API Gateway is pretty Quick to set up, but the industry is moving away from it as a concept. Keycloak is nice but requires some work.

> An API Gateway is pretty Quick to set up, but the industry is moving away from it as a concept.

Can you elaborate on this?

Re: Ask HN: What is the best way to add authentication to REST API (for mobile)?

#9

Auth0 is not a bad option. For JWT to support revocation, you must store them in the database and delete them on logout or when they expire.

To clarify for JWT invalidation, you don’t have to store the whole token. Instead just store the jti or some other identifying field that can be checked.

Re: Ask HN: What is the best way to add authentication to REST API (for mobile)?

#10

Auth0 is not a bad option. For JWT to support revocation, you must store them in the database and delete them on logout or when they expire.

To clarify for JWT invalidation, you don’t have to store the whole token. Instead just store the jti or some other identifying field that can be checked.

Can you please elaborate on this?
Post reply on HN