---
title: "Comment by Emmanuel Gruffy on \"Single Sign-On, JWT Authentication, and React\" | Hashnode"
description: "Gal Malachi 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 fro"
url: "https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/64e626b0cae237eabaaba617"
---

[Discussion](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4)

Comment [Single Sign-On, JWT Authentication, and React](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4)

[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
