mx-moth / flask-saml2

Flask library for building SAML Service Providers and Identity Providers
MIT License
70 stars 61 forks source link

August-W: Made ServiceProvider more configurable without needing to extend it #20

Open August-W opened 4 years ago

August-W commented 4 years ago

Added class variables in ServiceProvider for logout_endpoint, login_return_endpoint, entity_id, and acs_redirect_endpoint, and added parameters in the create_blueprint method. With acs_redirect_endpoint, you can explicitly set the relay_state in AssertionConsumer, for cases in which the SAML Request does not contain a relay_state parameter. Now, if you don't want to use a url to the saml xml file as your entity_id (default behaviour), you can set the entity_id in ServiceProvider.

Fixed an issue with the Login class in views.py. It now supports setting the scheme to "https" (this happens in ServiceProvider's create_blueprint method).

Updated the example sp.py accordingly.

Linked Issues: https://github.com/timheap/flask-saml2/issues/17 https://github.com/timheap/flask-saml2/issues/18 https://github.com/timheap/flask-saml2/issues/19

mkilp commented 4 years ago

@timheap can we merge this?

lucasSzavara commented 3 years ago

Is there an update on this? I'm thinking of using this library, but not being able to use https as the scheme is preventing me from using it

August-W commented 3 years ago

Hey @lucasSzavara, I'm not sure if this is getting merged but for now you can just extend ServiceProvider and Login and make the same changes I did here, or you can use my fork

lucasSzavara commented 3 years ago

Thanks @August-W! I'll use your fork, is there anything that I need to change on my code, other than including the scheme parameter?

August-W commented 3 years ago

No problem, @lucasSzavara. You shouldn't have to change anything else. It's been a while since I've looked at this but let me know if you run into any issues.