Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oauth_provider is ignored in pn.serve() #2629

Closed
marchakov-ody opened this issue Aug 11, 2021 · 1 comment · Fixed by #3293
Closed

oauth_provider is ignored in pn.serve() #2629

marchakov-ody opened this issue Aug 11, 2021 · 1 comment · Fixed by #3293
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@marchakov-ody
Copy link

Running server using the pn.serve function with oauth_provider set:
pn.serve(app, oauth_provider='custom', cookie_secret='...')
does not provide oauth_provider value to opts, so the server runs as if it has no oauth_provider configured (regardless of the oauth_provider value - it can be custom or any of the default providers).
If show=True argument for pn.serve() is provided, the server attempts to open /login page, but returns the 404: Not Found page and the following message in the console:
WARNING:tornado.access:404 GET /login (::1) 0.00ms

The problem seems to be caused by panel/io/server.py code, as was mentioned in this comment. As suggested in the same comment, replacing

 if config.oauth_provider:
     from ..auth import OAuthProvider
     opts['auth_provider'] = OAuthProvider()
 if oauth_provider:
     config.oauth_provider = oauth_provider

with

 if oauth_provider:
        from ..auth import OAuthProvider
        config.oauth_provider = oauth_provider
        opts["auth_provider"] = OAuthProvider()

seems to fix the issue.

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Aug 12, 2021
@philippjfr philippjfr added this to the 0.12.2 milestone Aug 12, 2021
@BiswajitTri
Copy link

if you are using pn.serve() then oauth attributes can be set with pn.config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants