Skip to content
This repository was archived by the owner on Dec 3, 2021. It is now read-only.
This repository was archived by the owner on Dec 3, 2021. It is now read-only.

OAuthReceiver: required params question #39

Description

@vajnorcan

Hi guys,

I'm giving this package a try, and while I understand there are different implementations of OAuth (probably), I don't seem to get the requirement of providing the 'tokenUrl' and 'clientId', 'clientSecret??' to the OAuthReceiver...

If I understand it right, OAuthSender and OAuthReceiver are supposed to co-exist. I use OAuthSender to open the oauth provider's gate, once the user provides the username/pwd, the oauth gate will return me the basic info as:

  • token,
  • clientId..
  • ...

I would expect the OAuthReceiver just to parse the incoming params and provide the success/fails hooks. Why is it required for the OAuthReceiver to provide him the 'clientSecret' (user has already signed in!) and 'tokenUrl' (if token has been already received)..

Also, another question would be regarding the redirect in onOAuthSuccess callback after the successful login ... the from or to (depends on how you look at it). Wouldn't that be always empty as it's effectively a redirect from the OAuth providers gate that's happening?

  1. User opens the react app
  2. Clicks the protected route and I prompt him to loging to the auth provider
  3. He clicks and then the react app pretty much unmounts (losing all the router state)
  4. OAuth gate opens, user signs in, and the gate then redirects to the redirect uri (our application)
  5. Our application initializes again, how the receiver then knows what was the last state.from ??

You see, I'm trying to do the protected routes with dynamic routes and I was hoping this would help me to resolve my issues, but it seems like I'll have to dynamically update the redirectURI to reflect the target url.

thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions