org.pac4j.core.engine.CallbackLogic Java Examples
The following examples show how to use
org.pac4j.core.engine.CallbackLogic.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CallbackHandler.java From vertx-pac4j with Apache License 2.0 | 6 votes |
@Override public void handle(RoutingContext event) { final CallbackLogic<Void, VertxWebContext> bestLogic = FindBest.callbackLogic(null, config, DefaultCallbackLogic.INSTANCE); final HttpActionAdapter<Void, VertxWebContext> bestAdapter = FindBest.httpActionAdapter(null, config, VertxHttpActionAdapter.INSTANCE); // Can we complete the authentication process here? final VertxWebContext webContext = new VertxWebContext(event, sessionStore); vertx.executeBlocking(future -> { bestLogic.perform(webContext, config, bestAdapter, defaultUrl, saveInSession, multiProfile, renewSession, defaultClient); future.complete(null); }, false, asyncResult -> { // If we succeeded we're all good here, the job is done either through approving, or redirect, or // forbidding // However, if an error occurred we need to handle this here if (asyncResult.failed()) { event.fail(new TechnicalException(asyncResult.cause())); } }); }
Example #2
Source File: DefaultFeatureSupport.java From dropwizard-pac4j with Apache License 2.0 | 5 votes |
@Override public void setup(Bootstrap<?> bootstrap) { ObjectMapper om = bootstrap.getObjectMapper(); // for Config om.addMixIn(SessionStore.class, sessionStoreMixin()); om.addMixIn(Authorizer.class, authorizerMixin()); om.addMixIn(HttpActionAdapter.class, httpActionAdapterMixin()); om.addMixIn(Matcher.class, matcherMixin()); om.addMixIn(SecurityLogic.class, securityLogicMixin()); om.addMixIn(CallbackLogic.class, callbackLogicMixin()); om.addMixIn(LogoutLogic.class, logoutLogicMixin()); // for Clients om.addMixIn(Client.class, clientMixin()); om.addMixIn(BaseClient.class, baseClientMixin()); // for Clients and Client subsclasses om.addMixIn(AjaxRequestResolver.class, ajaxRequestResolverMixin()); om.addMixIn(UrlResolver.class, urlResolverMixin()); om.addMixIn(CallbackUrlResolver.class, callbackUrlResolverMixin()); om.addMixIn(AuthorizationGenerator.class, authorizationGeneratorMixin()); // for Client/BaseClient om.addMixIn(Authenticator.class, authenticatorMixin()); om.addMixIn(CredentialsExtractor.class, credentialExtractorMixin()); om.addMixIn(ProfileCreator.class, profileCreatorMixin()); // for IndirectClient om.addMixIn(RedirectActionBuilder.class, redirectActionBuilderMixin()); om.addMixIn(LogoutActionBuilder.class, logoutActionBuilderMixin()); // for some of the Authenticators om.addMixIn(PasswordEncoder.class, passwordEncoderMixin()); }
Example #3
Source File: CallbackFilter.java From jax-rs-pac4j with Apache License 2.0 | 5 votes |
protected CallbackLogic<Object, JaxRsContext> buildLogic(Config config) { if (callbackLogic != null) { return callbackLogic; } else if (config.getCallbackLogic() != null) { return config.getCallbackLogic(); } else { DefaultCallbackLogic<Object, JaxRsContext> logic = new DefaultCallbackLogic<>(); logic.setProfileManagerFactory(JaxRsProfileManager::new); return logic; } }
Example #4
Source File: CallbackController.java From spring-webmvc-pac4j with Apache License 2.0 | 5 votes |
@RequestMapping("${pac4j.callback.path:/callback}") public void callback(final HttpServletRequest request, final HttpServletResponse response) { final SessionStore<JEEContext> bestSessionStore = FindBest.sessionStore(null, config, JEESessionStore.INSTANCE); final HttpActionAdapter<Object, JEEContext> bestAdapter = FindBest.httpActionAdapter(null, config, JEEHttpActionAdapter.INSTANCE); final CallbackLogic<Object, JEEContext> bestLogic = FindBest.callbackLogic(callbackLogic, config, DefaultCallbackLogic.INSTANCE); final JEEContext context = (JEEContext) FindBest.webContextFactory(null, config, JEEContextFactory.INSTANCE) .newContext(request, response, bestSessionStore); bestLogic.perform(context, config, bestAdapter, this.defaultUrl, this.saveInSession, this.multiProfile, this.renewSession, this.defaultClient); }
Example #5
Source File: CallbackFilter.java From jee-pac4j with Apache License 2.0 | 5 votes |
@Override protected void internalFilter(final HttpServletRequest request, final HttpServletResponse response, final FilterChain chain) throws IOException, ServletException { final Config config = getSharedConfig(); final SessionStore<JEEContext> bestSessionStore = FindBest.sessionStore(null, config, JEESessionStore.INSTANCE); final HttpActionAdapter<Object, JEEContext> bestAdapter = FindBest.httpActionAdapter(null, config, JEEHttpActionAdapter.INSTANCE); final CallbackLogic<Object, JEEContext> bestLogic = FindBest.callbackLogic(callbackLogic, config, DefaultCallbackLogic.INSTANCE); final JEEContext context = new JEEContext(request, response, bestSessionStore); bestLogic.perform(context, config, bestAdapter, this.defaultUrl, this.saveInSession, this.multiProfile, this.renewSession, this.defaultClient); }
Example #6
Source File: Pac4jFactory.java From dropwizard-pac4j with Apache License 2.0 | 4 votes |
@JsonProperty public CallbackLogic getCallbackLogic() { return callbackLogic; }
Example #7
Source File: CallbackFilter.java From jax-rs-pac4j with Apache License 2.0 | 4 votes |
public CallbackLogic<Object, JaxRsContext> getCallbackLogic() { return callbackLogic; }
Example #8
Source File: CallbackFilter.java From jax-rs-pac4j with Apache License 2.0 | 4 votes |
public void setCallbackLogic(CallbackLogic<Object, JaxRsContext> callbackLogic) { this.callbackLogic = callbackLogic; }
Example #9
Source File: CallbackController.java From spring-webmvc-pac4j with Apache License 2.0 | 4 votes |
public CallbackLogic<Object, JEEContext> getCallbackLogic() { return callbackLogic; }
Example #10
Source File: CallbackController.java From spring-webmvc-pac4j with Apache License 2.0 | 4 votes |
public void setCallbackLogic(final CallbackLogic<Object, JEEContext> callbackLogic) { this.callbackLogic = callbackLogic; }
Example #11
Source File: Pac4jCallbackHandler.java From pippo with Apache License 2.0 | 4 votes |
public CallbackLogic<Object, PippoWebContext> getCallbackLogic() { return callbackLogic; }
Example #12
Source File: Pac4jCallbackHandler.java From pippo with Apache License 2.0 | 4 votes |
public Pac4jCallbackHandler setCallbackLogic(CallbackLogic<Object, PippoWebContext> callbackLogic) { this.callbackLogic = callbackLogic; return this; }
Example #13
Source File: CallbackFilter.java From jee-pac4j with Apache License 2.0 | 4 votes |
public CallbackLogic<Object, JEEContext> getCallbackLogic() { return callbackLogic; }
Example #14
Source File: CallbackFilter.java From jee-pac4j with Apache License 2.0 | 4 votes |
public void setCallbackLogic(final CallbackLogic<Object, JEEContext> callbackLogic) { this.callbackLogic = callbackLogic; }
Example #15
Source File: Pac4jFactory.java From dropwizard-pac4j with Apache License 2.0 | 2 votes |
/** * @since 1.1.1 * * @param callbackLogic * the {@link CallbackLogic} to use globally */ @JsonProperty public void setCallbackLogic(CallbackLogic callbackLogic) { this.callbackLogic = callbackLogic; }