0

I am using JWT token to access google Api for audit reports Api(a part of admin sdk api) have authorization issues while using service account(service account doesn't have access so we have to impersonate admin user).

i have used the following code:

 Algorithm algorithm = Algorithm.RSA256((RSAPublicKey) null, (RSAPrivateKey) privateKey);
       
            signedJwt = JWT.create()
                    .withIssuer("serviceAccountEmail")
                    .withSubject("serviceAccountEmail")
                    .withAudience("https://google.googleapis.com/")
                    .withIssuedAt(new Date(now))
                    .withExpiresAt(new Date(now + 3600 * 1000L))
                    .sign(algorithm);

I want to impersonate an user here, how to do?

0 Answers0