emmett icon indicating copy to clipboard operation
emmett copied to clipboard

Oauth/openid support

Open KellerKev opened this issue 5 years ago • 3 comments

Could you add openid/oauth2 sso support to emmett please? ;)

KellerKev avatar Sep 07 '20 10:09 KellerKev

@Kkeller83 OpenID/Oauth2 is quite a huge topic.

Maybe you can describe this a bit more or give us an idea about which features do you expect to have? Or even a 3rd part framework/project you have in mind as a comparison?

I think this can be an extension (I'm not sure should be part of the framework itself), but I need more details in order to build up a plan.

gi0baro avatar Sep 14 '20 09:09 gi0baro

So I prototyped an application in web2py, which I was about port a implement in py4web, the successor framework of web2py this week, but I also followed your framwork and it looks really compelling. Thing is I really need the app to support SSO via OIDC. That is the main use case. With py4web I have already figured out how to do SSO via Okta, Akamai Identity Cloud and KeyCloak through OIDC, but with Emmett I did not see I straight forward way other than coding it myself, which I was thinking about and base it on your old weppy oidc/oauth plugin. But as everyone I am in a bit of time squeeze and you know the framework better and did in the past with weppy so I thought for you maybe its not such a big deal, but I am happy to help as well

KellerKev avatar Sep 14 '20 11:09 KellerKev

@Kkeller83 FYI I put together some SSO code (Github only at the moment) in an app I published recently, see:

  • https://github.com/gi0baro/tfstater/blob/d6882af13761fc30ce2cd122bf3c99979f3e144c/tfstater/idp.py
  • https://github.com/gi0baro/tfstater/blob/d6882af13761fc30ce2cd122bf3c99979f3e144c/tfstater/views/accounts.py#L55-L94

This implementation is quite specific, since I need to check additional attributes in github data, and also the templating part is quite project-related, but it might be a good starting point.

I think it might be possible to make a generic extension out of that code, as soon as more providers are implemented.

gi0baro avatar Nov 18 '21 19:11 gi0baro