@@ -133,44 +133,22 @@ def process_request(self, request=None, **kwargs):
133
133
if token .is_active () is False :
134
134
return self .error_cls (error = "invalid_token" , error_description = "Invalid Token" )
135
135
136
- allowed = True
137
- _auth_event = _grant .authentication_event
138
- # if the authentication is still active or offline_access is granted.
139
- if not _auth_event ["valid_until" ] >= utc_time_sans_frac ():
140
- logger .debug (
141
- "authentication not valid: {} > {}" .format (
142
- datetime .fromtimestamp (_auth_event ["valid_until" ]),
143
- datetime .fromtimestamp (utc_time_sans_frac ()),
144
- )
145
- )
146
- allowed = False
147
-
148
- # This has to be made more fine grained.
149
- # if "offline_access" in session["authn_req"]["scope"]:
150
- # pass
151
-
152
- if allowed :
153
- _cntxt = self .upstream_get ("context" )
154
- _claims_restriction = _cntxt .claims_interface .get_claims (
155
- _session_info ["branch_id" ], scopes = token .scope , claims_release_point = "userinfo"
156
- )
157
- info = _cntxt .claims_interface .get_user_claims (
158
- _session_info ["user_id" ], claims_restriction = _claims_restriction
159
- )
160
- info ["sub" ] = _grant .sub
161
- if _grant .add_acr_value ("userinfo" ):
162
- info ["acr" ] = _grant .authentication_event ["authn_info" ]
136
+ _cntxt = self .upstream_get ("context" )
137
+ _claims_restriction = _cntxt .claims_interface .get_claims (
138
+ _session_info ["branch_id" ], scopes = token .scope , claims_release_point = "userinfo"
139
+ )
140
+ info = _cntxt .claims_interface .get_user_claims (
141
+ _session_info ["user_id" ], claims_restriction = _claims_restriction
142
+ )
143
+ info ["sub" ] = _grant .sub
144
+ if _grant .add_acr_value ("userinfo" ):
145
+ info ["acr" ] = _grant .authentication_event ["authn_info" ]
163
146
164
- if "userinfo" in _cntxt .cdb [request ["client_id" ]]:
165
- self .config ["policy" ] = _cntxt .cdb [request ["client_id" ]]["userinfo" ]["policy" ]
147
+ if "userinfo" in _cntxt .cdb [request ["client_id" ]]:
148
+ self .config ["policy" ] = _cntxt .cdb [request ["client_id" ]]["userinfo" ]["policy" ]
166
149
167
- if "policy" in self .config :
168
- info = self ._enforce_policy (request , info , token , self .config )
169
- else :
170
- info = {
171
- "error" : "invalid_request" ,
172
- "error_description" : "Access not granted" ,
173
- }
150
+ if "policy" in self .config :
151
+ info = self ._enforce_policy (request , info , token , self .config )
174
152
175
153
return {"response_args" : info , "client_id" : _session_info ["client_id" ]}
176
154
0 commit comments