org.eclipse.jetty.security.authentication.LoginAuthenticator Java Examples
The following examples show how to use
org.eclipse.jetty.security.authentication.LoginAuthenticator.
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: AppEngineAuthentication.java From appengine-java-vm-runtime with Apache License 2.0 | 5 votes |
/** * Inject custom {@link LoginService} and {@link Authenticator} * implementations into the specified {@link ConstraintSecurityHandler}. */ public static void configureSecurityHandler( ConstraintSecurityHandler handler, VmRuntimeTrustedAddressChecker checker) { LoginService loginService = new AppEngineLoginService(); LoginAuthenticator authenticator = new AppEngineAuthenticator(checker); DefaultIdentityService identityService = new DefaultIdentityService(); // Set allowed roles. handler.setRoles(new HashSet<String>(Arrays.asList(new String[] {USER_ROLE, ADMIN_ROLE}))); handler.setLoginService(loginService); handler.setAuthenticator(authenticator); handler.setIdentityService(identityService); authenticator.setConfiguration(handler); }
Example #2
Source File: Application.java From rest-utils with Apache License 2.0 | 5 votes |
protected LoginAuthenticator createAuthenticator() { final String method = config.getString(RestConfig.AUTHENTICATION_METHOD_CONFIG); if (enableBasicAuth(method)) { return new BasicAuthenticator(); } else if (enableBearerAuth(method)) { throw new UnsupportedOperationException( "Must implement Application.createAuthenticator() when using '" + RestConfig.AUTHENTICATION_METHOD_CONFIG + "=" + RestConfig.AUTHENTICATION_METHOD_BEARER + "'." ); } return null; }
Example #3
Source File: ApplicationTest.java From rest-utils with Apache License 2.0 | 5 votes |
@Test(expected = UnsupportedOperationException.class) public void testBearerNoLoginService() { final Map<String, Object> config = ImmutableMap.of( RestConfig.AUTHENTICATION_METHOD_CONFIG, RestConfig.AUTHENTICATION_METHOD_BEARER); Application app = new TestApp(config) { @Override protected LoginAuthenticator createAuthenticator() { return new BasicAuthenticator(); } }; app.createBearerSecurityHandler(); }
Example #4
Source File: DrillHttpConstraintSecurityHandler.java From Bats with Apache License 2.0 | 4 votes |
public void setup(LoginAuthenticator authenticator, LoginService loginService) { final Set<String> knownRoles = ImmutableSet.of(AUTHENTICATED_ROLE, ADMIN_ROLE); setConstraintMappings(Collections.<ConstraintMapping>emptyList(), knownRoles); setAuthenticator(authenticator); setLoginService(loginService); }
Example #5
Source File: ProxyAuthenticator.java From datacollector with Apache License 2.0 | 4 votes |
public ProxyAuthenticator(LoginAuthenticator authenticator, RuntimeInfo runtimeInfo, Configuration conf) { this.authenticator = authenticator; this.runtimeInfo = runtimeInfo; this.conf = conf; }