Changeset 5909 for main/waeup.sirp/trunk/src
- Timestamp:
- 1 Apr 2011, 14:21:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/authentication.py
r5907 r5909 187 187 class ApplicantsAuthenticatorPlugin(grok.GlobalUtility): 188 188 """Authenticate applicants. 189 190 XXX: This plugin currently accepts any input and authenticates the191 user as applicant.192 189 """ 193 190 grok.provides(IAuthenticatorPlugin) … … 195 192 196 193 def authenticateCredentials(self, credentials): 194 """Validate the given `credentials` 195 196 Credentials for applicants have to be passed as a regular 197 dictionary with a key ``accesscode``. This access code is the 198 password and username of an applicant. 199 200 Returns a :class:`ApplicantPrincipalInfo` in case of 201 successful validation, ``None`` else. 202 203 Credentials are not valid if: 204 205 - The passed accesscode does not exist (i.e. was not generated 206 by the :mod:`waeup.sirp.accesscode` module). 207 208 or 209 210 - the accesscode was disabled 211 212 or 213 214 - the accesscode was already used and a dataset for this 215 applicant was already generated with a different accesscode 216 (currently impossible, as applicant datasets are indexed by 217 accesscode) 218 219 or 220 221 - a dataset for the applicant already exists with an 222 accesscode set and this accesscode does not match the given 223 one. 224 225 """ 197 226 if not isinstance(credentials, dict): 198 227 return None … … 204 233 appl_ac = getattr(applicant_data, 'access_code', None) 205 234 if ac is None: 235 return None 236 if ac.disabled is not False: 206 237 return None 207 238 if ac.invalidation_date is not None and appl_ac != ac.representation:
Note: See TracChangeset for help on using the changeset viewer.