# Auth0 Architecture and setup for React / Spring Boot

**URL:** <https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130>\
**Category:** Get Help\
**Created:** [July 14, 2021, 10:52am UTC](https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130 "2021-07-14T10:52:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan.abbitt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.abbitt/32/12778_2.png) [@dan.abbitt](https://community.auth0.com/u/dan.abbitt)\
**Post date:** [July 14, 2021, 10:52am UTC](https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130/1 "2021-07-14T10:52:02Z")

</div>

I’m looking at using Auth0 as an authentication provider for our stack but am struggling a bit with setting up APIs / Applications etc. This is what we’d like to do:

**Front End**  
We use React apps with NextJS for internal / external administrative portals.  
Internal users have Google Suite accounts.  
I’d like internal users to be able to log in to portals using their corporate G Suite accounts (saves having another login)  
I’d like external users to be able to log in to portals using manually created accounts within Auth0

The React apps will make requests to Spring Boot microservices for data load. The call should be authenticated using the user’s login token.

**APIs**  
We have a suite of B2B APIs that we’d like to use Auth0 for authentication / authorisation. These APIs will be accessed by external partners as well as internally owned apps.

What I’ve tried to do so far is set up a Single Page App for a React portal and, using Next-Auth, I have that connecting to Auth0 allowing a G Suite login. I have also created an API for the Spring Boot back end for the portal and have the service able to verify a token against Auth0. The challenge I’m facing is that the token in the React app does not verify with the API, they’re encoded differently. I think I’ve set it up incorrectly, hence this post!

Thanks!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 14, 2021, 3:27pm UTC](https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130/3 "2021-07-14T15:27:18Z")

</div>

Hi @dan.abbitt,

Welcome to the Auth0 Community and thanks for the thourough explanation!

How is the token different? Is it [not a JWT](https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028)?

---

<div class="post-metadata">

**Author:** ![dan.abbitt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.abbitt/32/12778_2.png) [@dan.abbitt](https://community.auth0.com/u/dan.abbitt)\
**Post date:** [July 15, 2021, 8:23am UTC](https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130/4 "2021-07-15T08:23:30Z")

</div>

Hi @dan.woda,

Thanks for getting back to me.

Both tokens I receive are JWTs however the token the React app has is HS512 and the API is expecting RS256.

I think I’m getting stuck on how to permission a user to use the API when logged in to a SPA.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 15, 2021, 4:00pm UTC](https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130/5 "2021-07-15T16:00:56Z")

</div>

You can change your signing algo like this:

[https://auth0.com/docs/applications/change-application-signing-algorithms](https://auth0.com/docs/applications/change-application-signing-algorithms)

---

<div class="post-metadata">

**Author:** ![dan.abbitt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.abbitt/32/12778_2.png) [@dan.abbitt](https://community.auth0.com/u/dan.abbitt)\
**Post date:** [July 23, 2021, 2:31pm UTC](https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130/6 "2021-07-23T14:31:16Z")

</div>

Thanks for the link.

@dan.woda, it should be possible for someone logging in to an SPA through a Google account to be able to call the API? If so, is there a good guide on how to configure that?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 23, 2021, 8:30pm UTC](https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130/7 "2021-07-23T20:30:28Z")

</div>

@dan.abbitt,

To call your backend API? The [React Quickstart is a solid example.](https://auth0.com/docs/quickstart/spa/react) Here is a general [SPA + API example.](https://auth0.com/docs/microsites/call-api/call-api-single-page-app)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 23, 2021, 4:24pm UTC](https://community.auth0.com/t/auth0-architecture-and-setup-for-react-spring-boot/66130/8 "2021-08-23T16:24:47Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
