congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Cas20ServiceTicketValidator.extractCustomAttributes
Code IndexAdd Tabnine to your IDE (free)

How to use
extractCustomAttributes
method
in
org.jasig.cas.client.validation.Cas20ServiceTicketValidator

Best Java code snippets using org.jasig.cas.client.validation.Cas20ServiceTicketValidator.extractCustomAttributes (Showing top 3 results out of 315)

origin: apereo/java-cas-client

return super.extractCustomAttributes(xml);
origin: org.jasig.cas/com.springsource.org.jasig.cas.client

protected final Assertion parseResponseFromServer(final String response) throws TicketValidationException {
  final String error = XmlUtils.getTextForElement(response,
      "authenticationFailure");
  if (CommonUtils.isNotBlank(error)) {
    throw new TicketValidationException(error);
  }
  final String principal = XmlUtils.getTextForElement(response, "user");
  final String proxyGrantingTicketIou = XmlUtils.getTextForElement(
      response, "proxyGrantingTicket");
  final String proxyGrantingTicket = this.proxyGrantingTicketStorage != null ? this.proxyGrantingTicketStorage.retrieve(proxyGrantingTicketIou) : null;
  if (CommonUtils.isEmpty(principal)) {
    throw new TicketValidationException("No principal was found in the response from the CAS server.");
  }
  final Assertion assertion;
  final Map attributes = extractCustomAttributes(response);
  if (CommonUtils.isNotBlank(proxyGrantingTicket)) {
    final AttributePrincipal attributePrincipal = new AttributePrincipalImpl(principal, attributes, proxyGrantingTicket, this.proxyRetriever);
    assertion = new AssertionImpl(attributePrincipal);
  } else {
    assertion = new AssertionImpl(new AttributePrincipalImpl(principal, attributes));
  }
  customParseResponse(response, assertion);
  return assertion;
}
origin: apereo/java-cas-client

protected Assertion parseResponseFromServer(final String response) throws TicketValidationException {
  final String error = parseAuthenticationFailureFromResponse(response);
  if (CommonUtils.isNotBlank(error)) {
    throw new TicketValidationException(error);
  }
  final String principal = parsePrincipalFromResponse(response);
  final String proxyGrantingTicketIou = parseProxyGrantingTicketFromResponse(response);
  final String proxyGrantingTicket;
  if (CommonUtils.isBlank(proxyGrantingTicketIou) || this.proxyGrantingTicketStorage == null) {
    proxyGrantingTicket = null;
  } else {
    proxyGrantingTicket = this.proxyGrantingTicketStorage.retrieve(proxyGrantingTicketIou);
  }
  if (CommonUtils.isEmpty(principal)) {
    throw new TicketValidationException("No principal was found in the response from the CAS server.");
  }
  final Assertion assertion;
  final Map<String, Object> attributes = extractCustomAttributes(response);
  if (CommonUtils.isNotBlank(proxyGrantingTicket)) {
    final AttributePrincipal attributePrincipal = new AttributePrincipalImpl(principal, attributes,
        proxyGrantingTicket, this.proxyRetriever);
    assertion = new AssertionImpl(attributePrincipal);
  } else {
    assertion = new AssertionImpl(new AttributePrincipalImpl(principal, attributes));
  }
  customParseResponse(response, assertion);
  return assertion;
}
org.jasig.cas.client.validationCas20ServiceTicketValidatorextractCustomAttributes

Javadoc

Default attribute parsing of attributes that look like the following: <cas:attributes> <cas:attribute1>value</cas:attribute1> <cas:attribute2>value</cas:attribute2> </cas:attributes>

Attributes look like following also parsed correctly: <cas:attributes><cas:attribute1>value</cas:attribute1><cas:attribute2>value</cas:attribute2></cas:attributes>

This code is here merely for sample/demonstration purposes for those wishing to modify the CAS2 protocol. You'll probably want a more robust implementation or to use SAML 1.1

Popular methods of Cas20ServiceTicketValidator

  • <init>
    Constructs an instance of the CAS 2.0 Service Ticket Validator with the supplied CAS server url pref
  • setProxyCallbackUrl
  • setProxyGrantingTicketStorage
  • setRenew
  • setEncoding
  • setProxyRetriever
  • customParseResponse
    Template method if additional custom parsing (such as Proxying) needs to be done.
  • getEncoding
  • setCustomParameters
  • encodeUrl
  • getURLConnectionFactory
  • parseAuthenticationFailureFromResponse
  • getURLConnectionFactory,
  • parseAuthenticationFailureFromResponse,
  • parsePrincipalFromResponse,
  • parseProxyGrantingTicketFromResponse,
  • setHostnameVerifier,
  • setURLConnectionFactory,
  • validate

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Permission (java.security)
    Legacy security code; do not use.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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