Tabnine Logo
ClientRegistrationException
Code IndexAdd Tabnine to your IDE (free)

How to use
ClientRegistrationException
in
org.springframework.security.oauth2.provider

Best Java code snippets using org.springframework.security.oauth2.provider.ClientRegistrationException (Showing top 8 results out of 315)

origin: cloudfoundry/uaa

@Override
protected void doFilterInternal(HttpServletRequest request,
    HttpServletResponse response, FilterChain chain)
        throws IOException, ServletException {
  try{
    String header = request.getHeader("Authorization");
    if (header == null || !header.startsWith("Basic ")) {
      chain.doFilter(request, response);
      return;
    }
    String[] decodedHeader = extractAndDecodeHeader(header, request);
    //Validate against client lockout policy
    String clientId = decodedHeader[0];
    //Validate against client secret expiration in the zone configured client secret policy
    Timestamp lastModified = (Timestamp) clientDetailsService.loadClientByClientId(clientId).getAdditionalInformation().get(ClientConstants.LAST_MODIFIED);
  } catch(BadCredentialsException e) {
    super.getAuthenticationEntryPoint().commence(request, response, e);
    return;
  } catch(ClientRegistrationException e) {
    logger.debug(e.getMessage());
  }
  //call parent class to authenticate
  super.doFilterInternal(request, response, chain);
}
origin: dhis2/dhis2-core

@Override
public ClientDetails loadClientByClientId( String clientId ) throws ClientRegistrationException
{
  ClientDetails clientDetails = clientDetails( oAuth2ClientService.getOAuth2ClientByClientId( clientId ) );
  if ( clientDetails == null )
  {
    throw new ClientRegistrationException( "Invalid client_id" );
  }
  return clientDetails;
}
origin: malike/sso-auth

@Override
public ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException {
  ClientDetail clientDetails = clientDetailsRepository.findByClientId(clientId);
  if (null == clientDetails) {
    throw new ClientRegistrationException("Client not found with id '" + clientId + "'");
  }
  return getClientFromMongoDBClientDetails(clientDetails);
}
origin: entando/entando-core

  ConsumerRecordVO consumer = this.getConsumerDAO().getConsumer(clientId);
  if (null == consumer) {
    throw new ClientRegistrationException("Client with id '" + clientId + "' does not exists");
    throw new ClientRegistrationException("Client '" + clientId + "' is expired");
} catch (Exception t) {
  logger.error("Error extracting consumer record by key {}", clientId, t);
  throw new ClientRegistrationException("Error extracting consumer record by key " + clientId, t);
origin: dhis2/dhis2-core

  @Override
  public UserDetails loadUserByUsername( String username ) throws UsernameNotFoundException
  {
    try
    {
      return super.loadUserByUsername( username );
    }
    catch ( ClientRegistrationException ex )
    {
      throw new UsernameNotFoundException( ex.getMessage(), ex );
    }
  }
}
origin: fangchunzao/SpringSecurityOauth2

throw new ClientRegistrationException("该应用不存在!");
origin: entando/entando-core

public void testLoadClientByInvalidClientId() {
  try {
    this.oauthConsumerManager.loadClientByClientId("invalid");
    fail();
  } catch (ClientRegistrationException t) {
    assertEquals("Client with id 'invalid' does not exists", t.getMessage());
  } catch (Throwable t) {
    throw t;
  }
}
origin: entando/entando-core

public void testFailLoadClientByClientId() throws Throwable {
  ConsumerRecordVO consumer = this.createConsumer("key_3", "secret_3", true);
  try {
    assertNull(this.oauthConsumerManager.getConsumerRecord(consumer.getKey()));
    oauthConsumerManager.addConsumer(consumer);
    ConsumerRecordVO extractedConsumer = oauthConsumerManager.getConsumerRecord(consumer.getKey());
    assertNotNull(extractedConsumer);
    this.oauthConsumerManager.loadClientByClientId("key_3");
    fail();
  } catch (ClientRegistrationException t) {
    assertEquals("Client 'key_3' is expired", t.getMessage());
  } catch (Throwable t) {
    throw t;
  } finally {
    oauthConsumerManager.deleteConsumer(consumer.getKey());
    assertNull(this.oauthConsumerManager.getConsumerRecord(consumer.getKey()));
  }
}
org.springframework.security.oauth2.providerClientRegistrationException

Most used methods

  • <init>
  • getMessage

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • getContentResolver (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
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