---
title: "Discussion on \"Single Sign-On, JWT Authentication, and React\" | Hashnode"
description: "Discussion on \"Single Sign-On, JWT Authentication, and React\". In this series of posts, we create a secured end-to-end JWT-based authentication mechanism using NodeJS, Express, PassportJS, and React.\nIn this series I cover:\n\nPart 1:  Background and Backend using NodeJS\nPart 2:  React & JWT Authentication\nPart 3:..."
url: "https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Single Sign-On, JWT Authentication, and React](https://blog.galmalachi.com/single-sign-on-jwt-authentication-and-react?utm_source=hashnode&utm_medium=feed)

In this series of posts, we create a secured end-to-end JWT-based authentication mechanism using NodeJS, Express, PassportJS, and React. In this series I cover: Part 1: Background and Backend using NodeJS Part 2: React & JWT Authentication Part 3:...

Dec 22, 2020 · 10 min read · blog.galmalachi.com  
Read the article

-   [#jwt](https://hashnode.com/tag/jwt)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#authentication](https://hashnode.com/tag/authentication)

## Written by

[Gal Malachi](https://hashnode.com/@galm)

@galm · Tel Aviv, Israel

  
[View profile](https://hashnode.com/@galm)

Developer

Fast learner, innovative, curious, highly motivated with a 'can-do' approach. I enjoy challenges and I thrive where there are technical questions that need to be answered.

## Responses 3

Markdown supported · ⌘↵ to post

[Emmanuel Gruffy](https://hashnode.com/@emmanuelG)

[Aug 23, 2023](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/64e626b0cae237eabaaba617)

[Gal Malachi](https://hashnode.com/@galm) First thanks a lot for this in-depth article, I found it while investigating ways and best practices for implementing JWT along with SSO (on the frontend side) so this was exactly what I needed. One small question if I may (I know it's been a while since this was published :) - in my case we don't use Axios interceptors, but rather we wrote our own wrapper function that handles all API calls, and called it 'apiClient' (which uses good old 'fetch' eventually). in that case - how would you recommend going on with updating our wrapper with the first access token that we receive as soon as the app initializes? does exposing a function like 'setAccessToken' from our wrapper and assigning it with the received token would be a consideration? i.e. let's say I use your hook useToken but instead of calling Axios interecpt, I do apiClient.setAccessToken(receivedToken) would love to hear your thoughts on this, and again sorry for raising this question a long time after this article went out - and again thanks so much for this helpful piece of knowledge

[Gal Malachi](https://hashnode.com/@galm)

[Aug 24, 2023](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/64e626b0cae237eabaaba617#reply-64e76f0dd47513fefda66d94)

Hi [Emmanuel Gruffy](https://hashnode.com/@emmanuelG) Absolutely, you can do that. You can also implement interceptors in your apiClient wrapper so you have a more robust method to handle the life cycle. But your suggested approach should definitely work

[Emmanuel Gruffy](https://hashnode.com/@emmanuelG)

[Aug 24, 2023](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/64e626b0cae237eabaaba617#reply-64e774a3cddf12fecdfc954b)

[Gal Malachi](https://hashnode.com/@galm) thanks! much appreciated

[M. Suman Patra](https://hashnode.com/@msuman)

[Dec 23, 2020](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/5fe2d5c5e28a2b6bca52c3ca)

Great article. Share Github repo url.

[Gal Malachi](https://hashnode.com/@galm)

[Dec 23, 2020](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/5fe2d5c5e28a2b6bca52c3ca#reply-5fe3134cb4b79006ffdac0e7)

Thanks [M. Suman Patra](https://hashnode.com/@msuman), I’ll try to publish it as soon as possible

[Braydon Coyer](https://hashnode.com/@braydoncoyer)

[Dec 22, 2020](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/5fe255c5c65ad56bef3a330a)

Just now finding out about this series - love it! I'm going to start from the beginning and read through them all!

[Gal Malachi](https://hashnode.com/@galm)

[Dec 22, 2020](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/5fe255c5c65ad56bef3a330a#reply-5fe2579fe28a2b6bca52bea7)

Thank you, [Braydon Coyer](https://hashnode.com/@braydoncoyer)!
