flask-saml2 icon indicating copy to clipboard operation
flask-saml2 copied to clipboard

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

Open August-W opened this issue 4 years ago • 5 comments

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

August-W avatar Apr 15 '20 00:04 August-W

@timheap can we merge this?

mkilp avatar Apr 29 '20 16:04 mkilp

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

lucasSzavara avatar Apr 05 '21 22:04 lucasSzavara

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

August-W avatar Apr 06 '21 04:04 August-W

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?

lucasSzavara avatar Apr 07 '21 14:04 lucasSzavara

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.

August-W avatar Apr 07 '21 15:04 August-W