ButlerOS / haskell-butler

BSD 3-Clause "New" or "Revised" License
89 stars 2 forks source link

Add Auth.OIDC and a social login demo application #36

Closed morucci closed 1 year ago

morucci commented 1 year ago

Only support Google Auth. The demo App propose a login button that redirect to Google in order to authenticate. Once authenticated the user is redirected to the demo App and the username is displayed.

morucci commented 1 year ago

This still needs some polishing but it seems to work and the flow is like as I expected. To test it you need to create an oauth 2 app on Google and set the env vars OIDC_ID and OIDC_PASSWORD then start Butler with: ./bin/run-ghcid ButlerDemos.demoSocialAuth

morucci commented 1 year ago

This is just the rebase

TristanCacqueray commented 1 year ago

That should be good now, though I haven't tested it yet :)

TristanCacqueray commented 1 year ago

I've added some more improvements in https://github.com/ButlerOS/haskell-butler/tree/butler-servant , to refactor the Workspace and Auth api wrappers.

morucci commented 1 year ago

Ok thanks, I've tested to login via the IDP with two different browsers and it seems to re-use the same session by just "Setting session provider". Also I see that guest username _ are incremented.

morucci commented 1 year ago

I've added some more improvements in https://github.com/ButlerOS/haskell-butler/tree/butler-servant , to refactor the Workspace and Auth api wrappers.

I fine with it. Do you plan to add that new commit into that PR ?

TristanCacqueray commented 1 year ago

Great, thanks for the contribution. I've proposed the servant refactor in #40 .