コード例 #1
0
        /// <summary>
        /// Call UDP store asynchronously to retrieve the Organization Identifier.
        /// </summary>
        /// <param name="accessToken">The bearer token to UDP.</param>
        /// <param name="projectGuid">The project id.</param>
        /// <returns>The HTTP GET Request to get the organization identifier.</returns>
        public static object GetOrgId(string accessToken, string projectGuid)
        {
            CheckUdpBuildConfig();

            string api = "/v1/core/api/projects/" + projectGuid;

            return(asyncRequest(kHttpVerbGET, BuildConfigInterface.GetApiEndpoint(), api, accessToken, null));
        }
コード例 #2
0
        /// <summary>
        /// Get Access Token according to authCode.
        /// </summary>
        /// <param name="authCode"> Acquired by UnityOAuth</param>
        /// <returns></returns>
        public static object GetAccessToken(string authCode)
        {
            CheckUdpBuildConfig();

            TokenRequest req = new TokenRequest();

            req.code          = authCode;
            req.client_id     = kOAuthClientId;
            req.client_secret = kOAuthClientSecret;
            req.grant_type    = "authorization_code";
            req.redirect_uri  = BuildConfigInterface.GetIdEndpoint();
            return(asyncRequest(kHttpVerbPOST, BuildConfigInterface.GetApiEndpoint(), "/v1/oauth2/token", null, req));
        }