congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AuthnRequest.getRequestedAuthnContext
Code IndexAdd Tabnine to your IDE (free)

How to use
getRequestedAuthnContext
method
in
org.opensaml.saml.saml2.core.AuthnRequest

Best Java code snippets using org.opensaml.saml.saml2.core.AuthnRequest.getRequestedAuthnContext (Showing top 5 results out of 315)

origin: spring-projects/spring-security-saml

protected RequestedAuthenticationContext getRequestedAuthenticationContext(AuthnRequest request) {
  RequestedAuthenticationContext result = null;
  if (request.getRequestedAuthnContext() != null) {
    AuthnContextComparisonTypeEnumeration comparison = request.getRequestedAuthnContext().getComparison();
    if (null != comparison) {
      result = RequestedAuthenticationContext.valueOf(comparison.toString());
    }
  }
  return result;
}
origin: spring-projects/spring-security-saml

protected AuthenticationContextClassReference getAuthenticationContextClassReference(AuthnRequest request) {
  AuthenticationContextClassReference result = null;
  final RequestedAuthnContext context = request.getRequestedAuthnContext();
  if (context != null && !CollectionUtils.isEmpty(context.getAuthnContextClassRefs())) {
    final String urn = context.getAuthnContextClassRefs().get(0).getAuthnContextClassRef();
    result = AuthenticationContextClassReference.fromUrn(urn);
  }
  return result;
}
origin: org.apereo.cas/cas-server-support-saml-idp-web

/**
 * Build redirect url by requested authn context.
 *
 * @param initialUrl   the initial url
 * @param authnRequest the authn request
 * @param request      the request
 * @return the redirect url
 */
protected String buildRedirectUrlByRequestedAuthnContext(final String initialUrl, final AuthnRequest authnRequest, final HttpServletRequest request) {
  val authenticationContextClassMappings = this.casProperties.getAuthn().getSamlIdp().getAuthenticationContextClassMappings();
  if (authnRequest.getRequestedAuthnContext() == null || authenticationContextClassMappings == null || authenticationContextClassMappings.isEmpty()) {
    return initialUrl;
  }
  val mappings = getAuthenticationContextMappings();
  val p =
    authnRequest.getRequestedAuthnContext().getAuthnContextClassRefs()
      .stream()
      .filter(ref -> {
        val clazz = ref.getAuthnContextClassRef();
        return mappings.containsKey(clazz);
      })
      .findFirst();
  if (p.isPresent()) {
    val mappedClazz = mappings.get(p.get().getAuthnContextClassRef());
    return initialUrl + '&' + casProperties.getAuthn().getMfa().getRequestParameter() + '=' + mappedClazz;
  }
  return initialUrl;
}
origin: org.apereo.cas/cas-server-support-saml-idp-web

@Override
public String build(final Object assertion,
          final RequestAbstractType authnRequest,
          final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
          final SamlRegisteredService service) {
  if (StringUtils.isNotBlank(service.getRequiredAuthenticationContextClass())) {
    LOGGER.debug("Using [{}] as indicated by SAML registered service [{}]",
      service.getRequiredAuthenticationContextClass(),
      service.getName());
    return service.getRequiredAuthenticationContextClass();
  }
  val defClass = StringUtils.defaultIfBlank(
    casProperties.getAuthn().getSamlIdp().getResponse().getDefaultAuthenticationContextClass(),
    AuthnContext.PPT_AUTHN_CTX);
  val requestedAuthnContext = authnRequest instanceof AuthnRequest
    ? AuthnRequest.class.cast(authnRequest).getRequestedAuthnContext() : null;
  if (requestedAuthnContext == null) {
    LOGGER.debug("No specific authN context is requested. Returning [{}]", defClass);
    return defClass;
  }
  val authnContextClassRefs = requestedAuthnContext.getAuthnContextClassRefs();
  if (authnContextClassRefs == null || authnContextClassRefs.isEmpty()) {
    LOGGER.debug("Requested authN context class ref is unspecified. Returning [{}]", defClass);
    return defClass;
  }
  val finalCtx = StringUtils.defaultIfBlank(getAuthenticationContextByAssertion(assertion,
    requestedAuthnContext, authnContextClassRefs), defClass);
  LOGGER.debug("Returning authN context [{}]", finalCtx);
  return finalCtx;
}
origin: net.shibboleth.idp/idp-saml-impl

  @Nonnull final AuthenticationContext authenticationContext) {
final RequestedAuthnContext requestedCtx = authnRequest.getRequestedAuthnContext();
if (requestedCtx == null) {
  log.debug("{} AuthnRequest did not contain a RequestedAuthnContext, nothing to do", getLogPrefix());
org.opensaml.saml.saml2.coreAuthnRequestgetRequestedAuthnContext

Javadoc

Gets the RequestedAuthnContext of the request.

Popular methods of AuthnRequest

  • setNameIDPolicy
    Sets the NameIDPolicy of the request.
  • setAssertionConsumerServiceURL
    Sets the URL of the particular Assertion Consumer Service to which the response to this request shou
  • setIssueInstant
  • setIssuer
  • setProtocolBinding
    Sets the protocol binding URI for the request.
  • setDestination
  • setID
  • setRequestedAuthnContext
    Sets the RequestedAuthnContext of the request.
  • setForceAuthn
    Sets whether the IdP should force the user to reauthenticate.
  • getAssertionConsumerServiceURL
    Gets the URL of the particular Assertion Consumer Service to which the response to this request shou
  • getProtocolBinding
    Gets the protocol binding URI for the request.
  • setIsPassive
    Sets whether the IdP should refrain from interacting with the user during the authentication process
  • getProtocolBinding,
  • setIsPassive,
  • setVersion,
  • getAssertionConsumerServiceIndex,
  • getNameIDPolicy,
  • getID,
  • getSubject,
  • isForceAuthn,
  • isPassive

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Kernel (java.awt.image)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now