ModShibAuth   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A auth_url() 0 4 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