This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$metadata['https://samltest.id/saml/sp'] = [ | |
'entityid' => 'https://samltest.id/saml/sp', | |
'attributemap' => 'unified2name', | |
'contacts' => [], | |
'metadata-set' => 'saml20-sp-remote', | |
'AssertionConsumerService' => [ | |
[ | |
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', | |
'Location' => 'https://samltest.id/Shibboleth.sso/SAML2/POST', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps | |
from flask import request, redirect, url_for | |
# custom decorator | |
def check_auth(f): | |
@wraps(f) | |
def decorated(*args, **kwargs): | |
if 'saml_user' not in session: | |
return redirect(url_for('login')) | |
return func(*args, **kwargs) |