Re: Redirect GET to POST

Aaron Dalton <[email protected]> Wed, 14 Jun 2017 05:16:32 -0700 (PDT)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
Let's get back to my initial question: 

Using MethodDispatcher, is it possible in a GET handler to redirect to a 
POST handler? I'm assuming it is not, given that nobody has said either way.

Based on that, then yes, I will have to find another solution, likely 
involving creating a different endpoint for this one case and refactoring 
some of the code to avoid duplication.

To answer your question, the POST in this case is necessary because the 
user needs to see what specific permissions the client is requesting and 
have the opportunity to back out or adjust those before approving the token.

- User clicks Log In button in whatever client (GET to initial oauth 
endpoint, which establishes a session and redirects to the main login page)
- User logs in (using password, Google, Facebook, whatever) (ultimately a 
POST to the core auth endpoint, though in a roundabout way if logging in 
with Google or something)
- User redirected to a page providing details on the client requesting 
access, what permissions they're requesting, and whatever other 
instructions they need to understand what's happening (GET to the 
authorization endpoint)
  - This is the step I want to skip if it's the official client trying to 
log in.
- User makes final decision as to the permissions to grant (POST to 
authorization endpoint)
- User is redirected to the authorized return URL with the token

On Tuesday, 13 June 2017 15:53:14 UTC-6, Joseph Tate wrote:
>
> Then don't you just redirect back to the return url? That's not your job 
> to post that data as the authenticating agency. Your app that is the 
> recipient of the redirect can issue auth tokens on a GET. That's not 
> something that requires a POST.
>
>
>>

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.