zyphr 0.1.37 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -1
- data/docs/AuthOAuthApi.md +12 -12
- data/docs/AuthRegistrationApi.md +145 -1
- data/docs/AuthUserDirectoryApi.md +627 -0
- data/docs/AuthUserProfileApi.md +0 -76
- data/docs/InviteEndUserRequest.md +26 -0
- data/docs/OAuthProviderName.md +15 -0
- data/docs/SetEndUserClaimsRequest.md +18 -0
- data/docs/SignInAnonymouslyRequest.md +5 -1
- data/docs/SignInWithGameCenterRequest.md +28 -0
- data/docs/SignInWithGooglePlayGamesRequest.md +18 -0
- data/docs/UpdateEndUserByApplicationRequest.md +26 -0
- data/lib/zyphr/api/auth_o_auth_api.rb +12 -12
- data/lib/zyphr/api/auth_registration_api.rb +138 -2
- data/lib/zyphr/api/auth_user_directory_api.rb +560 -0
- data/lib/zyphr/api/auth_user_profile_api.rb +0 -61
- data/lib/zyphr/models/invite_end_user_request.rb +309 -0
- data/lib/zyphr/models/o_auth_provider_name.rb +43 -0
- data/lib/zyphr/models/set_end_user_claims_request.rb +220 -0
- data/lib/zyphr/models/sign_in_anonymously_request.rb +43 -4
- data/lib/zyphr/models/sign_in_with_game_center_request.rb +373 -0
- data/lib/zyphr/models/sign_in_with_google_play_games_request.rb +238 -0
- data/lib/zyphr/models/update_end_user_by_application_request.rb +256 -0
- data/lib/zyphr.rb +7 -0
- data/spec/api/auth_registration_api_spec.rb +25 -1
- data/spec/api/auth_user_directory_api_spec.rb +136 -0
- data/spec/api/auth_user_profile_api_spec.rb +0 -12
- data/spec/models/invite_end_user_request_spec.rb +64 -0
- data/spec/models/o_auth_provider_name_spec.rb +30 -0
- data/spec/models/set_end_user_claims_request_spec.rb +36 -0
- data/spec/models/sign_in_anonymously_request_spec.rb +12 -0
- data/spec/models/sign_in_with_game_center_request_spec.rb +66 -0
- data/spec/models/sign_in_with_google_play_games_request_spec.rb +36 -0
- data/spec/models/update_end_user_by_application_request_spec.rb +60 -0
- data/zyphr.gemspec +1 -1
- metadata +450 -422
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af0784e6badcf3428abffcf5a6a88d0deb768baf45206e8edc15c811835eb7f7
|
|
4
|
+
data.tar.gz: 349dd9342bd68316b908ec87ef9464edccc460a5eafb240f0481a612ade70b83
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a5a4366857accac4b75f1d6a5de65304f3ef9bcc99302317f3f752ab3469a6ab30324427c9b64895cfe1d43ff80f1a5dd91027ed4e793785e0d0c18c0c6ce17e
|
|
7
|
+
data.tar.gz: 814bbbfb0880eb3dc482e83ac0c08cbd24ba73b9577d74b190569c0dd966ad0520ec68060e36566ef8c19d14f9c80ca0b477f1f1c886e15741d4f35e2c05ff56
|
data/README.md
CHANGED
|
@@ -188,12 +188,21 @@ Class | Method | HTTP request | Description
|
|
|
188
188
|
*Zyphr::AuthRegistrationApi* | [**convert_anonymous_user**](docs/AuthRegistrationApi.md#convert_anonymous_user) | **POST** /auth/users/convert | Convert anonymous account to a full account
|
|
189
189
|
*Zyphr::AuthRegistrationApi* | [**register_end_user**](docs/AuthRegistrationApi.md#register_end_user) | **POST** /auth/users/register | Register a new end user
|
|
190
190
|
*Zyphr::AuthRegistrationApi* | [**sign_in_anonymously**](docs/AuthRegistrationApi.md#sign_in_anonymously) | **POST** /auth/users/anonymous | Sign in anonymously
|
|
191
|
+
*Zyphr::AuthRegistrationApi* | [**sign_in_with_game_center**](docs/AuthRegistrationApi.md#sign_in_with_game_center) | **POST** /auth/game-center | Sign in with Apple Game Center
|
|
192
|
+
*Zyphr::AuthRegistrationApi* | [**sign_in_with_google_play_games**](docs/AuthRegistrationApi.md#sign_in_with_google_play_games) | **POST** /auth/google-play-games | Sign in with Google Play Games Services
|
|
191
193
|
*Zyphr::AuthSessionsApi* | [**list_end_user_sessions**](docs/AuthSessionsApi.md#list_end_user_sessions) | **GET** /auth/sessions | List active sessions
|
|
192
194
|
*Zyphr::AuthSessionsApi* | [**refresh_end_user_token**](docs/AuthSessionsApi.md#refresh_end_user_token) | **POST** /auth/sessions/refresh | Refresh access token
|
|
193
195
|
*Zyphr::AuthSessionsApi* | [**revoke_all_end_user_sessions**](docs/AuthSessionsApi.md#revoke_all_end_user_sessions) | **POST** /auth/sessions/revoke-all | Revoke all sessions
|
|
194
196
|
*Zyphr::AuthSessionsApi* | [**revoke_end_user_session**](docs/AuthSessionsApi.md#revoke_end_user_session) | **POST** /auth/sessions/revoke | Revoke a session
|
|
197
|
+
*Zyphr::AuthUserDirectoryApi* | [**delete_end_user_by_application**](docs/AuthUserDirectoryApi.md#delete_end_user_by_application) | **DELETE** /auth/users/{user_id} | Delete an end user (server-side admin)
|
|
198
|
+
*Zyphr::AuthUserDirectoryApi* | [**get_end_user_by_email**](docs/AuthUserDirectoryApi.md#get_end_user_by_email) | **GET** /auth/users/by-email | Look up an end user by email (server-side admin)
|
|
199
|
+
*Zyphr::AuthUserDirectoryApi* | [**get_end_user_by_id**](docs/AuthUserDirectoryApi.md#get_end_user_by_id) | **GET** /auth/users/{user_id} | Get an end user by id (server-side admin)
|
|
200
|
+
*Zyphr::AuthUserDirectoryApi* | [**get_end_user_claims**](docs/AuthUserDirectoryApi.md#get_end_user_claims) | **GET** /auth/users/{user_id}/claims | Get an end user's stored custom claims (server-side admin)
|
|
201
|
+
*Zyphr::AuthUserDirectoryApi* | [**invite_end_user**](docs/AuthUserDirectoryApi.md#invite_end_user) | **POST** /auth/users/invite | Pre-provision (invite) an end user (server-side admin)
|
|
202
|
+
*Zyphr::AuthUserDirectoryApi* | [**list_end_users**](docs/AuthUserDirectoryApi.md#list_end_users) | **GET** /auth/users | List / search end users (server-side admin)
|
|
203
|
+
*Zyphr::AuthUserDirectoryApi* | [**set_end_user_claims**](docs/AuthUserDirectoryApi.md#set_end_user_claims) | **PUT** /auth/users/{user_id}/claims | Set an end user's stored custom claims (server-side admin)
|
|
204
|
+
*Zyphr::AuthUserDirectoryApi* | [**update_end_user_by_application**](docs/AuthUserDirectoryApi.md#update_end_user_by_application) | **PATCH** /auth/users/{user_id} | Update an end user (server-side admin)
|
|
195
205
|
*Zyphr::AuthUserProfileApi* | [**delete_end_user**](docs/AuthUserProfileApi.md#delete_end_user) | **DELETE** /auth/users/me | Delete current end user account
|
|
196
|
-
*Zyphr::AuthUserProfileApi* | [**delete_end_user_by_application**](docs/AuthUserProfileApi.md#delete_end_user_by_application) | **DELETE** /auth/users/{user_id} | Delete an end user (test environment only)
|
|
197
206
|
*Zyphr::AuthUserProfileApi* | [**get_end_user**](docs/AuthUserProfileApi.md#get_end_user) | **GET** /auth/users/me | Get current end user profile
|
|
198
207
|
*Zyphr::AuthUserProfileApi* | [**update_end_user**](docs/AuthUserProfileApi.md#update_end_user) | **PATCH** /auth/users/me | Update current end user profile
|
|
199
208
|
*Zyphr::AuthWebAuthnApi* | [**delete_web_authn_credential**](docs/AuthWebAuthnApi.md#delete_web_authn_credential) | **DELETE** /auth/webauthn/credentials/{id} | Delete a WebAuthn credential
|
|
@@ -500,6 +509,7 @@ Class | Method | HTTP request | Description
|
|
|
500
509
|
- [Zyphr::InboxListMeta](docs/InboxListMeta.md)
|
|
501
510
|
- [Zyphr::InboxListResponse](docs/InboxListResponse.md)
|
|
502
511
|
- [Zyphr::InboxNotificationResponse](docs/InboxNotificationResponse.md)
|
|
512
|
+
- [Zyphr::InviteEndUserRequest](docs/InviteEndUserRequest.md)
|
|
503
513
|
- [Zyphr::ListWaaSApplications200Response](docs/ListWaaSApplications200Response.md)
|
|
504
514
|
- [Zyphr::ListWaaSEndpointDeliveries200Response](docs/ListWaaSEndpointDeliveries200Response.md)
|
|
505
515
|
- [Zyphr::ListWaaSEndpoints200Response](docs/ListWaaSEndpoints200Response.md)
|
|
@@ -544,6 +554,7 @@ Class | Method | HTTP request | Description
|
|
|
544
554
|
- [Zyphr::OAuthConnectionsResponseData](docs/OAuthConnectionsResponseData.md)
|
|
545
555
|
- [Zyphr::OAuthProvider](docs/OAuthProvider.md)
|
|
546
556
|
- [Zyphr::OAuthProviderInfo](docs/OAuthProviderInfo.md)
|
|
557
|
+
- [Zyphr::OAuthProviderName](docs/OAuthProviderName.md)
|
|
547
558
|
- [Zyphr::OAuthProvidersResponse](docs/OAuthProvidersResponse.md)
|
|
548
559
|
- [Zyphr::OAuthProvidersResponseData](docs/OAuthProvidersResponseData.md)
|
|
549
560
|
- [Zyphr::OAuthTokensRefreshResponse](docs/OAuthTokensRefreshResponse.md)
|
|
@@ -647,9 +658,12 @@ Class | Method | HTTP request | Description
|
|
|
647
658
|
- [Zyphr::SessionListResponseData](docs/SessionListResponseData.md)
|
|
648
659
|
- [Zyphr::SessionListResponseDataSessionInfo](docs/SessionListResponseDataSessionInfo.md)
|
|
649
660
|
- [Zyphr::SetDomainInboundRequest](docs/SetDomainInboundRequest.md)
|
|
661
|
+
- [Zyphr::SetEndUserClaimsRequest](docs/SetEndUserClaimsRequest.md)
|
|
650
662
|
- [Zyphr::SetPreferencesRequest](docs/SetPreferencesRequest.md)
|
|
651
663
|
- [Zyphr::SetPreferencesRequestPreferencesInner](docs/SetPreferencesRequestPreferencesInner.md)
|
|
652
664
|
- [Zyphr::SignInAnonymouslyRequest](docs/SignInAnonymouslyRequest.md)
|
|
665
|
+
- [Zyphr::SignInWithGameCenterRequest](docs/SignInWithGameCenterRequest.md)
|
|
666
|
+
- [Zyphr::SignInWithGooglePlayGamesRequest](docs/SignInWithGooglePlayGamesRequest.md)
|
|
653
667
|
- [Zyphr::SlackMessage](docs/SlackMessage.md)
|
|
654
668
|
- [Zyphr::SlackMessageListResponse](docs/SlackMessageListResponse.md)
|
|
655
669
|
- [Zyphr::SlackMessageListResponseMeta](docs/SlackMessageListResponseMeta.md)
|
|
@@ -705,6 +719,7 @@ Class | Method | HTTP request | Description
|
|
|
705
719
|
- [Zyphr::UnsubscribeRequest](docs/UnsubscribeRequest.md)
|
|
706
720
|
- [Zyphr::UnsubscribeResponse](docs/UnsubscribeResponse.md)
|
|
707
721
|
- [Zyphr::UpdateCategoryRequest](docs/UpdateCategoryRequest.md)
|
|
722
|
+
- [Zyphr::UpdateEndUserByApplicationRequest](docs/UpdateEndUserByApplicationRequest.md)
|
|
708
723
|
- [Zyphr::UpdateEndUserRequest](docs/UpdateEndUserRequest.md)
|
|
709
724
|
- [Zyphr::UpdateOrganizationMemberRoleRequest](docs/UpdateOrganizationMemberRoleRequest.md)
|
|
710
725
|
- [Zyphr::UpdateOrganizationRequest](docs/UpdateOrganizationRequest.md)
|
data/docs/AuthOAuthApi.md
CHANGED
|
@@ -39,7 +39,7 @@ Zyphr.configure do |config|
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
api_instance = Zyphr::AuthOAuthApi.new
|
|
42
|
-
provider =
|
|
42
|
+
provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
|
|
43
43
|
|
|
44
44
|
begin
|
|
45
45
|
# Disconnect OAuth provider
|
|
@@ -72,7 +72,7 @@ end
|
|
|
72
72
|
|
|
73
73
|
| Name | Type | Description | Notes |
|
|
74
74
|
| ---- | ---- | ----------- | ----- |
|
|
75
|
-
| **provider** | **
|
|
75
|
+
| **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
|
|
76
76
|
|
|
77
77
|
### Return type
|
|
78
78
|
|
|
@@ -110,7 +110,7 @@ Zyphr.configure do |config|
|
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
api_instance = Zyphr::AuthOAuthApi.new
|
|
113
|
-
provider =
|
|
113
|
+
provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
|
|
114
114
|
redirect_uri = 'redirect_uri_example' # String | Redirect URI after authorization
|
|
115
115
|
|
|
116
116
|
begin
|
|
@@ -144,7 +144,7 @@ end
|
|
|
144
144
|
|
|
145
145
|
| Name | Type | Description | Notes |
|
|
146
146
|
| ---- | ---- | ----------- | ----- |
|
|
147
|
-
| **provider** | **
|
|
147
|
+
| **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
|
|
148
148
|
| **redirect_uri** | **String** | Redirect URI after authorization | |
|
|
149
149
|
|
|
150
150
|
### Return type
|
|
@@ -186,7 +186,7 @@ Zyphr.configure do |config|
|
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
api_instance = Zyphr::AuthOAuthApi.new
|
|
189
|
-
provider =
|
|
189
|
+
provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
|
|
190
190
|
|
|
191
191
|
begin
|
|
192
192
|
# Get OAuth connection info
|
|
@@ -219,7 +219,7 @@ end
|
|
|
219
219
|
|
|
220
220
|
| Name | Type | Description | Notes |
|
|
221
221
|
| ---- | ---- | ----------- | ----- |
|
|
222
|
-
| **provider** | **
|
|
222
|
+
| **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
|
|
223
223
|
|
|
224
224
|
### Return type
|
|
225
225
|
|
|
@@ -262,7 +262,7 @@ Zyphr.configure do |config|
|
|
|
262
262
|
end
|
|
263
263
|
|
|
264
264
|
api_instance = Zyphr::AuthOAuthApi.new
|
|
265
|
-
provider =
|
|
265
|
+
provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
|
|
266
266
|
user_id = 'user_id_example' # String | End user ID
|
|
267
267
|
|
|
268
268
|
begin
|
|
@@ -296,7 +296,7 @@ end
|
|
|
296
296
|
|
|
297
297
|
| Name | Type | Description | Notes |
|
|
298
298
|
| ---- | ---- | ----------- | ----- |
|
|
299
|
-
| **provider** | **
|
|
299
|
+
| **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
|
|
300
300
|
| **user_id** | **String** | End user ID | |
|
|
301
301
|
|
|
302
302
|
### Return type
|
|
@@ -328,7 +328,7 @@ require 'time'
|
|
|
328
328
|
require 'zyphr'
|
|
329
329
|
|
|
330
330
|
api_instance = Zyphr::AuthOAuthApi.new
|
|
331
|
-
provider =
|
|
331
|
+
provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
|
|
332
332
|
o_auth_callback_request = Zyphr::OAuthCallbackRequest.new({code: 'code_example', state: 'state_example'}) # OAuthCallbackRequest |
|
|
333
333
|
|
|
334
334
|
begin
|
|
@@ -362,7 +362,7 @@ end
|
|
|
362
362
|
|
|
363
363
|
| Name | Type | Description | Notes |
|
|
364
364
|
| ---- | ---- | ----------- | ----- |
|
|
365
|
-
| **provider** | **
|
|
365
|
+
| **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
|
|
366
366
|
| **o_auth_callback_request** | [**OAuthCallbackRequest**](OAuthCallbackRequest.md) | | |
|
|
367
367
|
|
|
368
368
|
### Return type
|
|
@@ -545,7 +545,7 @@ Zyphr.configure do |config|
|
|
|
545
545
|
end
|
|
546
546
|
|
|
547
547
|
api_instance = Zyphr::AuthOAuthApi.new
|
|
548
|
-
provider =
|
|
548
|
+
provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
|
|
549
549
|
refresh_o_auth_tokens_request = Zyphr::RefreshOAuthTokensRequest.new({user_id: 'user_id_example'}) # RefreshOAuthTokensRequest |
|
|
550
550
|
|
|
551
551
|
begin
|
|
@@ -579,7 +579,7 @@ end
|
|
|
579
579
|
|
|
580
580
|
| Name | Type | Description | Notes |
|
|
581
581
|
| ---- | ---- | ----------- | ----- |
|
|
582
|
-
| **provider** | **
|
|
582
|
+
| **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
|
|
583
583
|
| **refresh_o_auth_tokens_request** | [**RefreshOAuthTokensRequest**](RefreshOAuthTokensRequest.md) | | |
|
|
584
584
|
|
|
585
585
|
### Return type
|
data/docs/AuthRegistrationApi.md
CHANGED
|
@@ -7,6 +7,8 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
7
7
|
| [**convert_anonymous_user**](AuthRegistrationApi.md#convert_anonymous_user) | **POST** /auth/users/convert | Convert anonymous account to a full account |
|
|
8
8
|
| [**register_end_user**](AuthRegistrationApi.md#register_end_user) | **POST** /auth/users/register | Register a new end user |
|
|
9
9
|
| [**sign_in_anonymously**](AuthRegistrationApi.md#sign_in_anonymously) | **POST** /auth/users/anonymous | Sign in anonymously |
|
|
10
|
+
| [**sign_in_with_game_center**](AuthRegistrationApi.md#sign_in_with_game_center) | **POST** /auth/game-center | Sign in with Apple Game Center |
|
|
11
|
+
| [**sign_in_with_google_play_games**](AuthRegistrationApi.md#sign_in_with_google_play_games) | **POST** /auth/google-play-games | Sign in with Google Play Games Services |
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
## convert_anonymous_user
|
|
@@ -155,7 +157,7 @@ end
|
|
|
155
157
|
|
|
156
158
|
Sign in anonymously
|
|
157
159
|
|
|
158
|
-
Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
|
|
160
|
+
Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert. Pass an optional `organization_id` to create the anonymous user directly in an organization; the returned access token then carries `org_id` (and `orgs`), matching the org-scoped register/login flow.
|
|
159
161
|
|
|
160
162
|
### Examples
|
|
161
163
|
|
|
@@ -219,3 +221,145 @@ end
|
|
|
219
221
|
- **Content-Type**: application/json
|
|
220
222
|
- **Accept**: application/json
|
|
221
223
|
|
|
224
|
+
|
|
225
|
+
## sign_in_with_game_center
|
|
226
|
+
|
|
227
|
+
> <AuthResultResponse> sign_in_with_game_center(sign_in_with_game_center_request)
|
|
228
|
+
|
|
229
|
+
Sign in with Apple Game Center
|
|
230
|
+
|
|
231
|
+
Exchange an Apple Game Center identity-verification assertion for a Zyphr end-user session. Zyphr independently re-verifies the assertion server-side (Apple certificate chain, RSA-SHA256 signature, timestamp freshness, single-use replay guard, and bundle-id binding) before provisioning-or-looking-up the user and minting tokens. The user is keyed on the modern scoped `playerId` (gamePlayerID). ## Producing the assertion (Integration) The assertion is produced **on-device by the iOS app** — there is no server-side way to mint it. The app calls GameKit's `GKLocalPlayer.fetchItems(forIdentityVerificationSignature:)`, which returns `publicKeyURL`, `signature`, `salt`, and `timestamp`; combine those with the local player's `gamePlayerID` and the app's bundle identifier and submit them here. Two integration shapes are supported: - **client-direct** — the iOS app holds the Zyphr application public key and calls this endpoint itself. - **backend-relayed** — the app forwards the fetched assertion fields to the customer's own backend, which relays them to this endpoint; the app never holds Zyphr keys. (This is the common shape for games.) On any verification failure the response is a single opaque `401` `invalid_assertion` — the specific control that failed is never disclosed.
|
|
232
|
+
|
|
233
|
+
### Examples
|
|
234
|
+
|
|
235
|
+
```ruby
|
|
236
|
+
require 'time'
|
|
237
|
+
require 'zyphr'
|
|
238
|
+
# setup authorization
|
|
239
|
+
Zyphr.configure do |config|
|
|
240
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
241
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
242
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
243
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
api_instance = Zyphr::AuthRegistrationApi.new
|
|
247
|
+
sign_in_with_game_center_request = Zyphr::SignInWithGameCenterRequest.new({player_id: 'player_id_example', public_key_url: 'public_key_url_example', signature: 'signature_example', salt: 'salt_example', timestamp: 3.56, bundle_id: 'bundle_id_example'}) # SignInWithGameCenterRequest |
|
|
248
|
+
|
|
249
|
+
begin
|
|
250
|
+
# Sign in with Apple Game Center
|
|
251
|
+
result = api_instance.sign_in_with_game_center(sign_in_with_game_center_request)
|
|
252
|
+
p result
|
|
253
|
+
rescue Zyphr::ApiError => e
|
|
254
|
+
puts "Error when calling AuthRegistrationApi->sign_in_with_game_center: #{e}"
|
|
255
|
+
end
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### Using the sign_in_with_game_center_with_http_info variant
|
|
259
|
+
|
|
260
|
+
This returns an Array which contains the response data, status code and headers.
|
|
261
|
+
|
|
262
|
+
> <Array(<AuthResultResponse>, Integer, Hash)> sign_in_with_game_center_with_http_info(sign_in_with_game_center_request)
|
|
263
|
+
|
|
264
|
+
```ruby
|
|
265
|
+
begin
|
|
266
|
+
# Sign in with Apple Game Center
|
|
267
|
+
data, status_code, headers = api_instance.sign_in_with_game_center_with_http_info(sign_in_with_game_center_request)
|
|
268
|
+
p status_code # => 2xx
|
|
269
|
+
p headers # => { ... }
|
|
270
|
+
p data # => <AuthResultResponse>
|
|
271
|
+
rescue Zyphr::ApiError => e
|
|
272
|
+
puts "Error when calling AuthRegistrationApi->sign_in_with_game_center_with_http_info: #{e}"
|
|
273
|
+
end
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Parameters
|
|
277
|
+
|
|
278
|
+
| Name | Type | Description | Notes |
|
|
279
|
+
| ---- | ---- | ----------- | ----- |
|
|
280
|
+
| **sign_in_with_game_center_request** | [**SignInWithGameCenterRequest**](SignInWithGameCenterRequest.md) | | |
|
|
281
|
+
|
|
282
|
+
### Return type
|
|
283
|
+
|
|
284
|
+
[**AuthResultResponse**](AuthResultResponse.md)
|
|
285
|
+
|
|
286
|
+
### Authorization
|
|
287
|
+
|
|
288
|
+
[ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
289
|
+
|
|
290
|
+
### HTTP request headers
|
|
291
|
+
|
|
292
|
+
- **Content-Type**: application/json
|
|
293
|
+
- **Accept**: application/json
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
## sign_in_with_google_play_games
|
|
297
|
+
|
|
298
|
+
> <AuthResultResponse> sign_in_with_google_play_games(sign_in_with_google_play_games_request)
|
|
299
|
+
|
|
300
|
+
Sign in with Google Play Games Services
|
|
301
|
+
|
|
302
|
+
Exchange a Google Play Games Services (GPGS) **server auth code** for a Zyphr end-user session. Unlike Game Center (which submits an Apple-signed assertion), GPGS is verified by Google: Zyphr exchanges the single-use server auth code at Google's OAuth2 token endpoint, then calls the Play Games REST API (`players/me`) server-side to obtain the trusted, tamper-proof `playerId`. The user is provisioned-or-looked-up on that server-fetched `playerId` and tokens are minted. ## Producing the server auth code (Integration) The server auth code is obtained **on-device by the Android app** — there is no server-side way to mint it. The app calls `GamesSignInClient.requestServerSideAccess(serverClientId, …)` using the Google Cloud **web (server) client id** configured for the game, which returns a single-use auth code string. Submit that string here as `serverAuthCode`. The **backend-relayed** shape is the common one: the app forwards the auth code to the customer's own backend, which relays it to this endpoint; the app never holds Zyphr keys. ## Security The `playerId` is derived **only** from Zyphr's own server-side call to Google after the token exchange — a client-supplied player id is never accepted or trusted. On any verification failure the response is a single opaque `401` `invalid_auth_code`; the specific control that failed is never disclosed.
|
|
303
|
+
|
|
304
|
+
### Examples
|
|
305
|
+
|
|
306
|
+
```ruby
|
|
307
|
+
require 'time'
|
|
308
|
+
require 'zyphr'
|
|
309
|
+
# setup authorization
|
|
310
|
+
Zyphr.configure do |config|
|
|
311
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
312
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
313
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
314
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
api_instance = Zyphr::AuthRegistrationApi.new
|
|
318
|
+
sign_in_with_google_play_games_request = Zyphr::SignInWithGooglePlayGamesRequest.new({server_auth_code: 'server_auth_code_example'}) # SignInWithGooglePlayGamesRequest |
|
|
319
|
+
|
|
320
|
+
begin
|
|
321
|
+
# Sign in with Google Play Games Services
|
|
322
|
+
result = api_instance.sign_in_with_google_play_games(sign_in_with_google_play_games_request)
|
|
323
|
+
p result
|
|
324
|
+
rescue Zyphr::ApiError => e
|
|
325
|
+
puts "Error when calling AuthRegistrationApi->sign_in_with_google_play_games: #{e}"
|
|
326
|
+
end
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
#### Using the sign_in_with_google_play_games_with_http_info variant
|
|
330
|
+
|
|
331
|
+
This returns an Array which contains the response data, status code and headers.
|
|
332
|
+
|
|
333
|
+
> <Array(<AuthResultResponse>, Integer, Hash)> sign_in_with_google_play_games_with_http_info(sign_in_with_google_play_games_request)
|
|
334
|
+
|
|
335
|
+
```ruby
|
|
336
|
+
begin
|
|
337
|
+
# Sign in with Google Play Games Services
|
|
338
|
+
data, status_code, headers = api_instance.sign_in_with_google_play_games_with_http_info(sign_in_with_google_play_games_request)
|
|
339
|
+
p status_code # => 2xx
|
|
340
|
+
p headers # => { ... }
|
|
341
|
+
p data # => <AuthResultResponse>
|
|
342
|
+
rescue Zyphr::ApiError => e
|
|
343
|
+
puts "Error when calling AuthRegistrationApi->sign_in_with_google_play_games_with_http_info: #{e}"
|
|
344
|
+
end
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Parameters
|
|
348
|
+
|
|
349
|
+
| Name | Type | Description | Notes |
|
|
350
|
+
| ---- | ---- | ----------- | ----- |
|
|
351
|
+
| **sign_in_with_google_play_games_request** | [**SignInWithGooglePlayGamesRequest**](SignInWithGooglePlayGamesRequest.md) | | |
|
|
352
|
+
|
|
353
|
+
### Return type
|
|
354
|
+
|
|
355
|
+
[**AuthResultResponse**](AuthResultResponse.md)
|
|
356
|
+
|
|
357
|
+
### Authorization
|
|
358
|
+
|
|
359
|
+
[ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
360
|
+
|
|
361
|
+
### HTTP request headers
|
|
362
|
+
|
|
363
|
+
- **Content-Type**: application/json
|
|
364
|
+
- **Accept**: application/json
|
|
365
|
+
|