forked from google/identity-toolkit-java-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
23 lines (20 loc) · 832 Bytes
/
Copy pathREADME
File metadata and controls
23 lines (20 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
This is Java client library for Google Identity Toolkit services.
Sample usage
=====================
/*
* initialize Gitkit client instance
*/
GitkitClient gitkitClient = GitkitClient.newBuilder()
.setGoogleClientId("your-oauth2-web-client-id-at-Google")
.setServiceAccountEmail("your-service-account-email-at-Google-developer-console")
.setKeyStream(new FileInputStream("path-to-your-service-account-private-file"))
.setWidgetUrl("/gitkit.jsp")
.setCookieName("gtoken")
.build();
// Verifies a GitkitToken
GitkitUser gitkitUser = gitkitClient.validateTokenInRequest(request);
// Download all accounts from Google Identity Toolkit
Iterator<GitkitUser> userIterator = gitkitClient.getAllUsers();
while (userIterator.hasNext()) {
// individual user info is returned in userIterator.next()
}