Search code examples
fusionauth

How to implement Apostropecms authentication with fusionauth


I am implementing Apostropecms authentication with fusionauth. For this I use the apostrophe-passport and passport-oauth2 modules. I am having problems at a step in the flow where I must obtain user information. I don't get user information from fusionauth by /oauth2/userinfo or /api/user.

I modified the passport-oauth2 strategy to adapt it to the fusionauth flow.

This is the error: InternalOAuthError: Failed to fetch user profile


Solution

  • You can use the User API or the Userinfo endpoint in the verify callback.

    To call the User API provide the accessToken passed into the verify callback to send to FusionAuth in the Authorization header as described in the API JWT authentication.

    Or use the Userinfo endpoint as described in the example.