Skip to content

support for oob/urn:ietf:wg:oauth:2.0:oob redirect uris #235

@vegitron

Description

@vegitron

I have client applications that aren't able to run a web server, or get redirects to a custom protocol. These are unix command line tools, not phone apps or websites. I would need to have users copy/paste their access codes so the app can get the tokens.

I was able to hack this functionality into place, by allowing oob:// as a custom protocol. Then in my service provider I subclassed the AuthorizationView, to turn any redirects to an oob:// url into a redirect to a custom view in my service provider that shows the access code:

class OOBAuthorizationView(AuthorizationView):

def post(self, *args, **kwargs):                                            
    value = super(SSAuthorizationView, self).post(args, **kwargs)           

    location = value.get("Location", "")                                    
    if location and re.match("oob://", location):                           
        new_base = reverse("oauth_access_code")                             
        new_url = "%s?code=" % new_base                                     
        location = re.sub("^oob://.*\?code=", new_url, location)            
        value["Location"] = location                                        
    return value   

I would really like to be able to get rid of this hack.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions