public Pac4jHandler(final Config config, final HttpExecutionContext httpExecutionContext, final String clients, final PlaySessionStore playSessionStore, final Pac4jRoleHandler rolePermissionsHandler) { CommonHelper.assertNotNull("config", config); CommonHelper.assertNotNull("httpExecutionContext", httpExecutionContext); CommonHelper.assertNotNull("playSessionStore", playSessionStore); this.config = config; this.httpExecutionContext = httpExecutionContext; this.clients = clients; this.playSessionStore = playSessionStore; this.rolePermissionsHandler = rolePermissionsHandler; }
public OidcExtractor(final OidcConfiguration configuration, final OidcClient client) { CommonHelper.assertNotNull("configuration", configuration); CommonHelper.assertNotNull("client", client); this.configuration = configuration; this.client = client; }
public OAuth20RedirectActionBuilder(final OAuth20Configuration configuration, final IndirectClient client) { CommonHelper.assertNotNull("client", client); CommonHelper.assertNotNull("configuration", configuration); this.configuration = configuration; this.client = client; }
/** * @param alternateIpHeaders Sets alternate headers to search for IP. * The first match will be returned as specified for {@code enhanced for} iteration over arrays. * @since 2.1.0 */ public void setAlternateIpHeaders(final String... alternateIpHeaders) { CommonHelper.assertNotNull("alternateIpHeaders", alternateIpHeaders); this.alternateIpHeaders = Arrays.asList(alternateIpHeaders); }
public void setKeyPair(final KeyPair keyPair) { CommonHelper.assertNotNull("keyPair", keyPair); this.privateKey = (RSAPrivateKey) keyPair.getPrivate(); this.publicKey = (RSAPublicKey) keyPair.getPublic(); }
public ShiroAesDataEncrypter(final String key) { CommonHelper.assertNotNull("key", key); logger.info("Using key: {}", key); this.key = key.getBytes(StandardCharsets.UTF_8); }
public void setKeyPair(final KeyPair keyPair) { CommonHelper.assertNotNull("keyPair", keyPair); this.privateKey = (ECPrivateKey) keyPair.getPrivate(); this.publicKey = (ECPublicKey) keyPair.getPublic(); }
@Override protected void internalInit() { CommonHelper.assertNotNull("secret", secret); CommonHelper.assertNotNull("algorithm", algorithm); CommonHelper.assertNotNull("method", method); if (!supports(this.algorithm, this.method)) { throw new TechnicalException("Only the direct and AES algorithms are supported with the appropriate encryption method"); } }
@Override public boolean isAuthorized(final WebContext context, final List<CommonProfile> profile) { CommonHelper.assertNotNull("pattern", pattern); final String ip = context.getRemoteAddr(); return this.pattern.matcher(ip).matches(); }
@Override protected void internalInit() { CommonHelper.assertNotNull("algorithm", algorithm); CommonHelper.assertNotNull("method", method); if (!supports(this.algorithm, this.method)) { throw new TechnicalException("Only RSA algorithms are supported with the appropriate encryption method"); } }
@Override public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { assertNotNull("logoutLogic", logoutLogic); assertNotNull("config", config); final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; final SessionStore<J2EContext> sessionStore = config.getSessionStore(); final J2EContext context = new J2EContext(request, response, sessionStore != null ? sessionStore : ShiroSessionStore.INSTANCE); logoutLogic.perform(context, config, J2ENopHttpActionAdapter.INSTANCE, this.defaultUrl, this.logoutUrlPattern, this.localLogout, false, this.centralLogout); }
@Override public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { assertNotNull("callbackLogic", callbackLogic); assertNotNull("config", config); final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; final SessionStore<J2EContext> sessionStore = config.getSessionStore(); final J2EContext context = new J2EContext(request, response, sessionStore != null ? sessionStore : ShiroSessionStore.INSTANCE); final HttpActionAdapter<Object, J2EContext> adapter = httpActionAdapter != null ? httpActionAdapter : J2ENopHttpActionAdapter.INSTANCE; callbackLogic.perform(context, config, adapter, this.defaultUrl, this.saveInSession, this.multiProfile, false, this.defaultClient); }
public SAML2RedirectActionBuilder(final SAML2Client client) { CommonHelper.assertNotNull("client", client); this.client = client; final SAML2Configuration cfg = client.getConfiguration(); this.saml2ObjectBuilder = new SAML2AuthnRequestBuilder(cfg); }
public CompletionStage<Result> callback() { assertNotNull("callbackLogic", callbackLogic); assertNotNull("config", config); final PlayWebContext playWebContext = new PlayWebContext(ctx(), playSessionStore); return CompletableFuture.supplyAsync(() -> callbackLogic.perform(playWebContext, config, config.getHttpActionAdapter(), this.defaultUrl, this.saveInSession, this.multiProfile, this.renewSession, this.defaultClient), ec.current()); }
public CompletionStage<Result> logout() { assertNotNull("logoutLogic", logoutLogic); assertNotNull("config", config); final PlayWebContext playWebContext = new PlayWebContext(ctx(), playSessionStore); return CompletableFuture.supplyAsync(() -> logoutLogic.perform(playWebContext, config, config.getHttpActionAdapter(), this.defaultUrl, this.logoutUrlPattern, this.localLogout, this.destroySession, this.centralLogout), ec.current()); }
public PlayWebContext(final Context context, final SessionStore<PlayWebContext> sessionStore) { this.context = context; this.request = context.request(); this.response = context.response(); this.session = context.session(); assertNotNull("sessionStore", sessionStore); this.sessionStore = sessionStore; }
@Override protected void internalInit() { CommonHelper.assertNotNull("pattern", pattern); defaultProfileDefinition(new CommonProfileDefinition<>(x -> new IpProfile())); }
@Override protected void clientInit() { if (getCredentialsExtractor() == null) { CommonHelper.assertNotBlank("headerName", this.headerName); CommonHelper.assertNotNull("prefixHeader", this.prefixHeader); defaultCredentialsExtractor(new HeaderExtractor(this.headerName, this.prefixHeader)); } }
@Override protected void clientInit() { CommonHelper.assertNotNull("configuration", configuration); configuration.setApi(Foursquare2Api.instance()); configuration.setProfileDefinition(new FoursquareProfileDefinition()); configuration.setScope("user"); defaultProfileCreator(new FoursquareProfileCreator(configuration, this)); defaultLogoutActionBuilder((ctx, profile, targetUrl) -> RedirectAction.redirect("https://www.foursquare.com/logout")); super.clientInit(); } }
@Override protected void clientInit() { CommonHelper.assertNotNull("configuration", getConfiguration()); getConfiguration().defaultDiscoveryURI("https://accounts.google.com/.well-known/openid-configuration"); final OidcProfileCreator<GoogleOidcProfile> profileCreator = new OidcProfileCreator<>(getConfiguration()); profileCreator.setProfileDefinition(new OidcProfileDefinition<>(x -> new GoogleOidcProfile())); defaultProfileCreator(profileCreator); defaultLogoutActionBuilder(new GoogleLogoutActionBuilder<>()); super.clientInit(); } }