reactjsscalaplaybacksilhouette

Silhouette - react + scala + play app authentication flow


I need to create basic app with a silhouette. What I need to do is:

I don't really know how this flow should look like. My idea is:

Will that flow work? Is there any simpler/better way to do that?


Solution

  • I had similar problem, so that's my proposal:

    1. Create a controller for social authentication on backend side.
    2. In react app add button for authentication and simply redirect to the backend endpoint.
    3. Authenticate user on backend, use Silhouette JWTAuthenticator to create a JWT token
    4. Redirect to the react app with JWT token in query params.
    5. Save token and use it in consequtive requests