瀏覽代碼

chore(game): move web service provider docs

Bryan Lee 1 年之前
父節點
當前提交
552e5e1c5d

+ 1 - 1
project/authentication/providers/web_oauth2_auth_provider.gd

@@ -49,7 +49,7 @@ func server_sign_in() -> Result:
 	
 	var response = request_result.unwrap()
 	if response.response_code != HTTPClient.RESPONSE_OK:
-		return Result.Err("failed to get data from Google's user info endpoint: %s" % response.response_code)
+		return Result.Err("failed to sign in: %s" % response.response_code)
 	
 	var body_text: String = response.body.get_string_from_utf8()
 	return Result.Ok(JSON.parse_string(body_text))

文件差異過大導致無法顯示
+ 0 - 0
project/export_presets.cfg


+ 3 - 0
project/services/docs/web_oauth.md

@@ -0,0 +1,3 @@
+# Steam in Godot
+
+Sign up as a [Steamworks partner](https://partner.steamgames.com/dashboard).

+ 1 - 1
project/services/service_manager.gd

@@ -32,7 +32,7 @@ func initialize_default_services() -> void:
 		"iOS":
 			initialize_service("res://services/apple_game_center_service.gd")
 		"Web":
-			initialize_service("res://services/web_oauth2/web_oauth2_service.gd")
+			initialize_service("res://services/web_oauth2_service.gd")
 
 
 ## [codeblock]

+ 0 - 23
project/services/web_oauth2/README.md

@@ -1,23 +0,0 @@
-# Web OAuth 2.0 in Godot
-
-We use Google's OAuth2.0 client for our application, but this can be augmented in the future to support more OAuth2.0 providers.
-
-## Setting up the OAuth2.0 client
-
-Go to the [Credentials page](https://console.cloud.google.com/apis/credentials) on Google Cloud Console and create a new OAuth client for the application.
-
-> The Google Cloud Project should already be created for Google Play Games Service.
-
-Head to the "OAuth consent screen" page and make sure to include any emails to be used for testing.
-
-## OAuth2.0 Flow
-
-Upon initialization, `WebOAuth2Service` requests an access code from Google's OAuth2.0 server by navigating to `https://accounts.google.com/o/oauth2/v2/auth`, which will redirect back to the web client on success with the access token in the URL hash under `access_token`.
-
-Whenever the web client is initialized, it checks the URL fragment hash for the access code and consumes it if it exists by storing the access token into local storage along with an expiry date then removing the hash from the URL.
-
-Whenever user information is needed, a request is made with the access token to Google's user info request URI.
-
-## Testing OAuth2.0 locally
-
-To allow the default web debugging client on `http://localhost:8060/tmp_js_export.html` to receive the authorization code, we need to add its URI to the authorized redirect URIs on the Google Cloud console, under the "Credentials" page.

+ 0 - 0
project/services/web_oauth2/web_oauth2_service.gd → project/services/web_oauth2_service.gd


部分文件因文件數量過多而無法顯示