credentials.writeTokenStorageToStream(os); LOG.debug("Wrote credentials for user {} to {}", ugiWithPrincipal.getPrincipal(), credentialsFile); PrincipalCredentials principalCredentials = new PrincipalCredentials(ugiWithPrincipal.getPrincipal(), credentialsFile.toURI().toString()); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(principalCredentials));
credentials.writeTokenStorageToStream(os); LOG.debug("Wrote credentials for user {} to {}", ugiWithPrincipal.getPrincipal(), credentialsFile); PrincipalCredentials principalCredentials = new PrincipalCredentials(ugiWithPrincipal.getPrincipal(), credentialsFile.toURI().toString()); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(principalCredentials));
private UGIWithPrincipal verifyAndGetUGI(UGIProvider provider, KerberosPrincipalId principalId, ImpersonationRequest impersonationRequest) throws IOException { UGIWithPrincipal ugiWithPrincipal = provider.getConfiguredUGI(impersonationRequest); Assert.assertEquals(UserGroupInformation.AuthenticationMethod.KERBEROS, ugiWithPrincipal.getUGI().getAuthenticationMethod()); Assert.assertEquals(principalId.getPrincipal(), ugiWithPrincipal.getPrincipal()); Assert.assertTrue(ugiWithPrincipal.getUGI().hasKerberosCredentials()); // Fetch it again, it is should return the same UGI since there is caching Assert.assertSame(ugiWithPrincipal.getUGI(), provider.getConfiguredUGI(impersonationRequest).getUGI()); return ugiWithPrincipal; }
eveUGIWithPrincipal.getUGI().getAuthenticationMethod()); Assert.assertTrue(eveUGIWithPrincipal.getUGI().hasKerberosCredentials()); Assert.assertEquals(eveKerberosPrincipalId.getPrincipal(), eveUGIWithPrincipal.getPrincipal());