Package org.pac4j.core.credentials

Examples of org.pac4j.core.credentials.Credentials


        client.setCallbackUrl(CALLBACK_URL);
        final MockWebContext context = MockWebContext.create();
        client.redirect(context, false, false);
        final String redirectionUrl = context.getResponseLocation();
        assertEquals(LOGIN_URL, redirectionUrl);
        final Credentials credentials = client.getCredentials(context);
        assertNull(credentials);
    }
View Full Code Here


    protected abstract String getCallbackUrl(final WebClient webClient, HtmlPage authorizationPage) throws Exception;

    protected UserProfile getCredentialsAndProfile(final Client client, final WebContext context) throws Exception {

        final Credentials credentials = client.getCredentials(context);
        logger.debug("credentials : {}", credentials);

        final UserProfile profile = client.getUserProfile(credentials, context);
        return profile;
    }
View Full Code Here

  @Override
  public void handle(Context context) {
    RatpackWebContext webContext = new RatpackWebContext(context);
    context.blocking(() -> {
      Client<Credentials, UserProfile> client = lookupClient.apply(context, webContext);
      Credentials credentials = client.getCredentials(webContext);
      return client.getUserProfile(credentials, webContext);
    }).onError(e -> {
      if (e instanceof RequiresHttpAction) {
        webContext.sendResponse((RequiresHttpAction) e);
      } else {
View Full Code Here

TOP

Related Classes of org.pac4j.core.credentials.Credentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.