test_class.declarator: authentication
test_class.modifier: private
test_class.original_string: private TokenAuthentication authentication;
test_class.type: TokenAuthentication
test_class.var_name: authentication
test_class.declarator: tokenProvider
test_class.modifier: private
test_class.original_string: private TokenProviderImpl tokenProvider;
test_class.type: TokenProviderImpl
test_class.var_name: tokenProvider
test_class.declarator: userId
test_class.modifier: private
test_class.original_string: private String userId;
test_class.type: String
test_class.var_name: userId
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/TokenAuthenticationTest.java
test_class.identifier: TokenAuthenticationTest
test_class.superclass: extends AbstractTokenTest
test_case.body: @Test
      public void testAuthenticateWithInvalidCredentials() throws Exception {
          List<Credentials> invalid = new ArrayList<>();
          invalid.add(new GuestCredentials());
          invalid.add(new SimpleCredentials(userId, new char[0]));
  
          for (Credentials creds : invalid) {
              assertFalse(authentication.authenticate(creds));
          }
      }
test_case.class_method_signature: TokenAuthenticationTest.testAuthenticateWithInvalidCredentials()
test_case.full_signature: @Test public void testAuthenticateWithInvalidCredentials()
test_case.identifier: testAuthenticateWithInvalidCredentials
test_case.invocations: add add assertFalse authenticate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAuthenticateWithInvalidCredentials()
focal_class.declarator: log = LoggerFactory.getLogger(TokenAuthentication.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(TokenAuthentication.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: tokenProvider
focal_class.modifier: private final
focal_class.original_string: private final TokenProvider tokenProvider;
focal_class.type: TokenProvider
focal_class.var_name: tokenProvider
focal_class.declarator: tokenInfo
focal_class.modifier: private
focal_class.original_string: private TokenInfo tokenInfo;
focal_class.type: TokenInfo
focal_class.var_name: tokenInfo
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenAuthentication.java
focal_class.identifier: TokenAuthentication
focal_class.interfaces: implements Authentication
focal_class.class_method_signature: TokenAuthentication.TokenAuthentication(@NotNull TokenProvider tokenProvider)
focal_class.full_signature:   TokenAuthentication(@NotNull TokenProvider tokenProvider)
focal_class.identifier: TokenAuthentication
focal_class.parameters: (@NotNull TokenProvider tokenProvider)
focal_class.signature:  TokenAuthentication(@NotNull TokenProvider tokenProvider)
focal_class.class_method_signature: TokenAuthentication.authenticate(@Nullable Credentials credentials)
focal_class.full_signature: @Override public boolean authenticate(@Nullable Credentials credentials)
focal_class.identifier: authenticate
focal_class.modifiers: @Override public
focal_class.parameters: (@Nullable Credentials credentials)
focal_class.return: boolean
focal_class.signature: boolean authenticate(@Nullable Credentials credentials)
focal_class.class_method_signature: TokenAuthentication.getUserId()
focal_class.full_signature: @Nullable @Override public String getUserId()
focal_class.identifier: getUserId
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUserId()
focal_class.class_method_signature: TokenAuthentication.getUserPrincipal()
focal_class.full_signature: @Nullable @Override public Principal getUserPrincipal()
focal_class.identifier: getUserPrincipal
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: ()
focal_class.return: Principal
focal_class.signature: Principal getUserPrincipal()
focal_class.class_method_signature: TokenAuthentication.getTokenInfo()
focal_class.full_signature: @NotNull TokenInfo getTokenInfo()
focal_class.identifier: getTokenInfo
focal_class.modifiers: @NotNull
focal_class.parameters: ()
focal_class.return: TokenInfo
focal_class.signature: TokenInfo getTokenInfo()
focal_class.class_method_signature: TokenAuthentication.validateCredentials(@NotNull TokenCredentials tokenCredentials)
focal_class.full_signature: private boolean validateCredentials(@NotNull TokenCredentials tokenCredentials)
focal_class.identifier: validateCredentials
focal_class.modifiers: private
focal_class.parameters: (@NotNull TokenCredentials tokenCredentials)
focal_class.return: boolean
focal_class.signature: boolean validateCredentials(@NotNull TokenCredentials tokenCredentials)
focal_method.body: @Override
      public boolean authenticate(@Nullable Credentials credentials) throws LoginException {
          if (credentials instanceof TokenCredentials) {
              TokenCredentials tc = (TokenCredentials) credentials;
              if (!validateCredentials(tc)) {
                  throw new LoginException("Invalid token credentials.");
              } else {
                  return true;
              }
          }
          // other credentials implementation -> not handled here.
          return false;
      }
focal_method.class_method_signature: TokenAuthentication.authenticate(@Nullable Credentials credentials)
focal_method.full_signature: @Override public boolean authenticate(@Nullable Credentials credentials)
focal_method.identifier: authenticate
focal_method.invocations: validateCredentials
focal_method.modifiers: @Override public
focal_method.parameters: (@Nullable Credentials credentials)
focal_method.return: boolean
focal_method.signature: boolean authenticate(@Nullable Credentials credentials)