test_class.declarator: SUBJECT = new Subject()
test_class.modifier: private static final
test_class.original_string: private static final Subject SUBJECT = new Subject();
test_class.type: Subject
test_class.var_name: SUBJECT
test_class.declarator: info
test_class.modifier: private
test_class.original_string: private AuthorizationHeaderParser.Result info;
test_class.type: AuthorizationHeaderParser.Result
test_class.var_name: info
test_class.file: agent/osgi/src/test/java/org/jolokia/osgi/security/JaasAuthenticatorTest.java
test_class.identifier: JaasAuthenticatorTest
test_case.body: @Test
      public void testAuthenticationNegative() throws Exception {
          HttpServletRequest req = prepareRequest();
  
          JaasAuthenticator auth = new JaasAuthenticator("jolokia") {
              @Override
              protected LoginContext createLoginContext(String realm, CallbackHandler handler) throws LoginException {
                  LoginContext mockLogin = mock(LoginContext.class);
                  mockLogin.login();
                  EasyMock.expectLastCall().andThrow(new LoginException("Failed"));
                  replay(mockLogin);
                  return mockLogin;
              }
          };
          assertFalse(auth.doAuthenticate(req, info));
      }
test_case.class_method_signature: JaasAuthenticatorTest.testAuthenticationNegative()
test_case.full_signature: @Test public void testAuthenticationNegative()
test_case.identifier: testAuthenticationNegative
test_case.invocations: prepareRequest mock login andThrow expectLastCall replay assertFalse doAuthenticate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAuthenticationNegative()
focal_class.declarator: realm
focal_class.modifier: private final
focal_class.original_string: private final String realm;
focal_class.type: String
focal_class.var_name: realm
focal_class.file: agent/osgi/src/main/java/org/jolokia/osgi/security/JaasAuthenticator.java
focal_class.identifier: JaasAuthenticator
focal_class.class_method_signature: JaasAuthenticator.JaasAuthenticator(String pRealm)
focal_class.full_signature: public  JaasAuthenticator(String pRealm)
focal_class.identifier: JaasAuthenticator
focal_class.modifiers: public
focal_class.parameters: (String pRealm)
focal_class.signature:  JaasAuthenticator(String pRealm)
focal_class.class_method_signature: JaasAuthenticator.doAuthenticate(HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo)
focal_class.full_signature: @Override protected boolean doAuthenticate(HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo)
focal_class.identifier: doAuthenticate
focal_class.modifiers: @Override protected
focal_class.parameters: (HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo)
focal_class.return: boolean
focal_class.signature: boolean doAuthenticate(HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo)
focal_class.class_method_signature: JaasAuthenticator.createLoginContext(String realm, CallbackHandler handler)
focal_class.full_signature: protected LoginContext createLoginContext(String realm, CallbackHandler handler)
focal_class.identifier: createLoginContext
focal_class.modifiers: protected
focal_class.parameters: (String realm, CallbackHandler handler)
focal_class.return: LoginContext
focal_class.signature: LoginContext createLoginContext(String realm, CallbackHandler handler)
focal_class.superclass: extends BaseAuthenticator
focal_method.body: @Override
      protected boolean doAuthenticate(HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo) {
          try {
              String user = pAuthInfo.getUser();
              String password = pAuthInfo.getPassword();
  
              final CallbackHandler handler = new UserPasswordCallbackHandler(user, password);
              LoginContext loginContext = createLoginContext(realm, handler);
              loginContext.login();
  
              pRequest.setAttribute(HttpContext.AUTHENTICATION_TYPE,HttpServletRequest.BASIC_AUTH);
              pRequest.setAttribute(HttpContext.REMOTE_USER, user);
              pRequest.setAttribute(ConfigKey.JAAS_SUBJECT_REQUEST_ATTRIBUTE,loginContext.getSubject());
  
              return true;
          } catch (LoginException e) {
              return false;
          }
      }
focal_method.class_method_signature: JaasAuthenticator.doAuthenticate(HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo)
focal_method.full_signature: @Override protected boolean doAuthenticate(HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo)
focal_method.identifier: doAuthenticate
focal_method.invocations: getUser getPassword createLoginContext login setAttribute setAttribute setAttribute getSubject
focal_method.modifiers: @Override protected
focal_method.parameters: (HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo)
focal_method.return: boolean
focal_method.signature: boolean doAuthenticate(HttpServletRequest pRequest, AuthorizationHeaderParser.Result pAuthInfo)