We are planning to build a new custom API component using spring boot which acts an API gateway. The custom API acts as a REST client and fetches the information from multiple REST API sources. The authentication should be done with one of the 3rd party application using REST API call and use the same authentication with the other 3rd party APIs. The 3rd party REST api only supports basic authentication. So The custom API component needs to pass either jsessionId or basic authentication details to fetch the information using the REST APIs. My questions
- Is it secure to pass the sessionToken to the clients (mobile) after successful authentication with the 3rd party? As the mobile apps needs to pass the token back to the custom api component for the REST calls after authentication?
- Or use JWT authentication for the custom api component and store the jsessionid and jwt in database and manage the sessions?
- Or always pass basic authentication?
- Can I use Spring Cloud Gateway Architecture for developing custom API component
I hope my queries are not clear. Also please suggest any suggestions for the architecture