Java Code Examples for com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload#setAuthorizedParty()

The following examples show how to use com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload#setAuthorizedParty() . 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: GoogleJwtAuthenticatorTest.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
  payload = new Payload();
  payload.setAuthorizedParty(CLIENT_ID);
  payload.setAudience(AUDIENCE);
  payload.setEmail(EMAIL);
  payload.setSubject(USER_ID);
  authenticator = new GoogleJwtAuthenticator(verifier);
  request = new MockHttpServletRequest();
  attr = Attribute.from(request);
  attr.set(Attribute.API_METHOD_CONFIG, config);
  attr.set(Attribute.ENABLE_CLIENT_ID_WHITELIST, true);
  request.addHeader(GoogleAuth.AUTHORIZATION_HEADER, "Bearer " + TOKEN);
  when(token.getPayload()).thenReturn(payload);
}
 
Example 2
Source File: GoogleIdTokenTest.java    From google-api-java-client with Apache License 2.0 5 votes vote down vote up
private static Payload newPayload(String userId, String clientId) {
  Payload payload = new Payload();
  payload.setIssuer("accounts.google.com");
  payload.setAudience(clientId);
  payload.setAuthorizedParty(clientId);
  payload.setSubject(userId);
  payload.setExpirationTimeSeconds(100L);
  payload.setIssuedAtTimeSeconds(0L);
  return payload;
}
 
Example 3
Source File: GoogleIdTokenVerifierTest.java    From google-api-java-client with Apache License 2.0 5 votes vote down vote up
private static Payload newPayload(String clientId) {
  Payload payload = new Payload();
  payload.setIssuer("accounts.google.com");
  payload.setAudience(clientId);
  payload.setAuthorizedParty(clientId);
  payload.setExpirationTimeSeconds(100L);
  payload.setIssuedAtTimeSeconds(0L);
  return payload;
}