reactjsspring-bootmicroservicesokta-apiokta-signin-widget

how to communicate with microservice which having okta enabled security


i have enable okta security in my microservice , now while testing from postman i am getting okta dialog box to put username and pwd, and then submit i get accesstoken which eventually use in postman to call a service , and until this much everything working fine.

now when come to integration with microservice from frontend react app, i cant allow okta login box to show, rathen i want accesstoken to be generated somehow by putting username , pwd from my react app login box and communication should occur with microservice with that token smoothly. i googled almost everything and found no such help.


Solution

  • It seems like there might be a more efficient way to handle your authentication process. Instead of implementing Okta security solely on the backend, you could allow your APIs to validate access tokens in JWT format.

    In your Okta setup, set the application type to ‘Single-Page App’. This change will ensure the best compatibility with the OAuth PKCE flow on the frontend. During this setup, don’t forget to enable refresh token rotation for secure and efficient token management.

    Once you have configured your frontend to use OAuth PKCE, it will retrieve access and refresh tokens. You can then pass these access tokens to your backend server API. The backend can independently authenticate requests by validating the JWT access tokens.