Skip to content

Commit

Permalink
cleaning code and debug cas inpn
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Jul 16, 2024
1 parent 6e8a31a commit 62f28ba
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
13 changes: 2 additions & 11 deletions src/pypnusershub/auth/providers/cas_inpn_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class AuthenficationCASINPN(Authentication):
name = "CAS_INPN_PROVIDER"
label = "INPN"
is_external = True
logo = "<i class='fa fa-paw' aria-hidden='true'></i>"
Expand Down Expand Up @@ -54,20 +53,15 @@ def authorize(self):
user = xml_dict["cas:serviceResponse"]["cas:authenticationSuccess"][
"cas:user"
]

if not user:
log.info("Erreur d'authentification lié au CAS, voir log du CAS")
log.error("Erreur d'authentification lié au CAS, voir log du CAS")
return render_template(
"cas_login_error.html",
cas_logout=self.URL_LOGOUT,
url_geonature=current_app.config["URL_APPLICATION"],
)
return redirect(self.logout_url)

ws_user_url = f"{self.URL_INFO}/{user}/?verify=false"
response = requests.get(
ws_user_url,
(
auth=(
self.WS_ID,
self.WS_PASSWORD,
),
Expand Down Expand Up @@ -144,9 +138,6 @@ class CASINPNConfiguration(ProviderConfigurationSchema):
URL_VALIDATION = fields.String(
load_default="https://inpn.mnhn.fr/auth/serviceValidate"
)
URL_AUTHORIZE = fields.String(
load_default="https://inpn.mnhn.fr/authentication/"
)
URL_INFO = fields.String(
load_default="https://inpn.mnhn.fr/authentication/information",
)
Expand Down
3 changes: 0 additions & 3 deletions src/pypnusershub/auth/providers/openid_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class OpenIDProvider(Authentication):
"""

name = "OPENID_PROVIDER_CONFIG"
logo = '<i class="fa fa-sign-in"></i>'
is_external = True
"""
Expand Down Expand Up @@ -106,8 +105,6 @@ class OpenIDConnectProvider(OpenIDProvider):
"""

name = "OPENID_CONNECT_PROVIDER_CONFIG"

def revoke(self):

if not "openid_token_resp" in session:
Expand Down
1 change: 0 additions & 1 deletion src/pypnusershub/auth/providers/usershub_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class ExternalUsersHubAuthProvider(Authentication):
Authentication provider for Flask application using UsersHub-authentification-module.
"""

name = "EXTERNAL_USERSHUB_PROVIDER_CONFIG"
logo = '<i class="fa fa-users"></i>'
is_external = False

Expand Down

0 comments on commit 62f28ba

Please sign in to comment.