ModShibAuth.auth_url()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
1
"""
2
A Python social backend that relies on Apache's mod_shib authentication.
3
"""
4
5
from .env import ServerEnvAuth
6
7
class ModShibAuth(ServerEnvAuth):
8
    name="modshib"
9
    ENV_USERNAME = "REMOTE_USER"
10
    ENV_EMAIL = "HTTP_SHIB_ORGPERSON_EMAILADDRESS"
11
    ENV_FIRST_NAME = "HTTP_SHIB_INETORGPERSON_GIVENNAME"
12
    ENV_LAST_NAME = "HTTP_SHIB_PERSON_SURNAME"
13
14
    def auth_url(self):
15
        """Must return redirect URL to auth provider."""
16
        url = "/Shibboleth.sso/Login?target="+self.redirect_uri
17
        return self.strategy.absolute_uri(url)
18
19