Hi, I am looking for a Solara Auth
Hi, I am looking for a Solara Auth example (okta provider) that I can reproduce. I tried https://solara.dev/documentation/examples/general/login_oauth but it points to a 502 error when I click on Login. Do you know of a working example?
9 Replies
Just to confirm, you get the login screen, but the redirect after signing in fails?
Looks to me like it points to
localhost:8765
, which might be a problem from our end. I'll take a look later today if I can get that fixedThanks! I have another question. Looking at the Solara docs I see no "template" redirect_uri for the login endpoint? I am new to this so I could be wrong but in okta's examples with Flask I usually see that it should be provided. Would it be something like
https://yourdomain.com/_solara/auth/login
?@iisakkirotko
As for your question "you get the login screen, but the redirect after signing in fails?", I see the Login button and when I click on it it goes to
and shows
Have you tried again since? I think the servers our website is hosted on were down in some regions.
The login endpoint for solara is
.../_solara/auth/login
, but you can also add another one by just creating a route that calls the login
function of solara enterprise. In case you mean the uri that users land on after logging in by redirect_uri
: by default, solara redirects the user back to the page they were on when clicking login, but you can configure the page by providing a uri (absolute or relative) as an argument to get_login_url
. This is not documented, but you can take a look at the implementation on github:
https://github.com/widgetti/solara/blob/b0e5c223016e6acfc114ea730c38443b77490269/packages/solara-enterprise/solara_enterprise/auth/utils.py#L27-L35
(Note that the login
function also takes an argument similarly)packages/solara-enterprise/solara_enterprise/auth/utils.py
lines 27 to 35
For adding a custom endpoint for signing in, you can take a look at how we implement it, for example for flask
solara/server/flask.py
lines 267 to 270