本文整理了Java中org.apereo.cas.authentication.Authentication.getAuthenticationDate()
方法的一些代码示例,展示了Authentication.getAuthenticationDate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Authentication.getAuthenticationDate()
方法的具体详情如下:
包路径:org.apereo.cas.authentication.Authentication
类名称:Authentication
方法名:getAuthenticationDate
暂无
代码示例来源:origin: org.apereo.cas/cas-server-core-authentication-api
@Override
public void update(final Authentication authn) {
this.attributes.putAll(authn.getAttributes());
this.authenticationDate = authn.getAuthenticationDate();
}
代码示例来源:origin: org.apereo.cas/cas-server-core-authentication-api
private Authentication buildAuthentication(final PrincipalElectionStrategy principalElectionStrategy) {
if (isEmpty()) {
LOGGER.warn("No authentication event has been recorded; CAS cannot finalize the authentication result");
return null;
}
val authenticationAttributes = new HashMap<String, Object>();
val principalAttributes = new HashMap<String, Object>();
val authenticationBuilder = DefaultAuthenticationBuilder.newInstance();
buildAuthenticationHistory(this.authentications, authenticationAttributes, principalAttributes, authenticationBuilder);
val primaryPrincipal = getPrimaryPrincipal(principalElectionStrategy, this.authentications, principalAttributes);
authenticationBuilder.setPrincipal(primaryPrincipal);
LOGGER.debug("Determined primary authentication principal to be [{}]", primaryPrincipal);
authenticationBuilder.setAttributes(authenticationAttributes);
LOGGER.trace("Collected authentication attributes for this result are [{}]", authenticationAttributes);
authenticationBuilder.setAuthenticationDate(ZonedDateTime.now());
val auth = authenticationBuilder.build();
LOGGER.trace("Authentication result commenced at [{}]", auth.getAuthenticationDate());
return auth;
}
代码示例来源:origin: org.apereo.cas/cas-server-core-authentication-attributes
attrs.put(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_AUTHENTICATION_DATE, CollectionUtils.wrap(authentication.getAuthenticationDate()));
代码示例来源:origin: org.apereo.cas/cas-server-support-saml-idp-web
/**
* Build cas assertion.
*
* @param authentication the authentication
* @param service the service
* @param registeredService the registered service
* @param attributesToCombine the attributes to combine
* @return the assertion
*/
protected Assertion buildCasAssertion(final Authentication authentication,
final Service service,
final RegisteredService registeredService,
final Map<String, Object> attributesToCombine) {
val attributes = registeredService.getAttributeReleasePolicy().getAttributes(authentication.getPrincipal(), service, registeredService);
val principal = new AttributePrincipalImpl(authentication.getPrincipal().getId(), attributes);
val authnAttrs = new LinkedHashMap(authentication.getAttributes());
authnAttrs.putAll(attributesToCombine);
return new AssertionImpl(principal, DateTimeUtils.dateOf(authentication.getAuthenticationDate()),
null, DateTimeUtils.dateOf(authentication.getAuthenticationDate()),
authnAttrs);
}
代码示例来源:origin: org.apereo.cas/cas-server-support-reports
val sso = new HashMap<String, Object>(SsoSessionAttributeKeys.values().length);
sso.put(SsoSessionAttributeKeys.AUTHENTICATED_PRINCIPAL.toString(), principal.getId());
sso.put(SsoSessionAttributeKeys.AUTHENTICATION_DATE.toString(), authentication.getAuthenticationDate());
sso.put(SsoSessionAttributeKeys.AUTHENTICATION_DATE_FORMATTED.toString(),
dateFormat.format(DateTimeUtils.dateOf(authentication.getAuthenticationDate())));
sso.put(SsoSessionAttributeKeys.NUMBER_OF_USES.toString(), tgt.getCountOfUses());
sso.put(SsoSessionAttributeKeys.TICKET_GRANTING_TICKET.toString(), tgt.getId());
代码示例来源:origin: org.apereo.cas/cas-server-support-saml
authentication.getAuthenticationDate(), authnMethods, principal.getId());
LOGGER.debug("Built authentication statement for [{}] dated at [{}]", principal, authentication.getAuthenticationDate());
代码示例来源:origin: org.apereo.cas/cas-server-webapp-reports
sso.put(SsoSessionAttributeKeys.AUTHENTICATION_DATE.toString(), authentication.getAuthenticationDate());
sso.put(SsoSessionAttributeKeys.AUTHENTICATION_DATE_FORMATTED.toString(),
dateFormat.format(DateTimeUtils.dateOf(authentication.getAuthenticationDate())));
sso.put(SsoSessionAttributeKeys.NUMBER_OF_USES.toString(), tgt.getCountOfUses());
sso.put(SsoSessionAttributeKeys.TICKET_GRANTING_TICKET.toString(), tgt.getId());
代码示例来源:origin: org.apereo.cas/cas-server-core-authentication-api
/**
* Creates a new builder initialized with data from the given authentication source.
*
* @param source Authentication source.
* @return New builder instance initialized with all fields in the given authentication source.
*/
public static AuthenticationBuilder newInstance(final Authentication source) {
val builder = new DefaultAuthenticationBuilder(source.getPrincipal());
builder.setAuthenticationDate(source.getAuthenticationDate());
builder.setCredentials(source.getCredentials());
builder.setSuccesses(source.getSuccesses());
builder.setFailures(source.getFailures());
builder.setAttributes(source.getAttributes());
return builder;
}
内容来源于网络,如有侵权,请联系作者删除!