0

アイデンティティツールキットfor Webサイトv3は、認証コードsignInSuccessコールバックtokenString引数を提供します。 //www.gstatic.com/authtoolkit/js/gitkit.jsもののアイデンティティツールキットfor Webサイトv3 add access_type =オフラインでparam値を継続するには?

は、難読化と文書化されていないですが、私は.gstatic.com/authtoolkit/JS/gitkit-debug.jsとするのが最良役立つはず を見つけましたが、それでも好奇心もっと良い方法があれば、もし私が何かが欠けているなら。

問題は、パラメータaccess_type = offlineを設定してリフレッシュトークンを取得できないため、Google API Client Library for Javaを使用し、idp google.comのログイン後のログインはオプションではないようです。 私は、連合のログインソリューションの提供でそれを使用することはできません。私はgoogleプロバイダoauthフローを個別に実装する必要があります...私はここで何かを見逃す必要があるとは思えません。

他のGoogle APIにアクセスするために使用できない場合は、URL#の認証コードへのアクセスを提供するポイントは何ですか。

いずれの場合でも、誰かが同じ問題を抱えていて、[この] [2]フォーラムディスカッションに見られるv1の解決策が提供されました。

レスポンスは「リフレッシュトークンを取得するさまざまな方法があります。つまり、Microsoftでは「wl.offline_access」スコープが必要です; Googleの場合、「access_type = offline」URLパラメータが必要です。 GITKitはまだ正規化された方法を持っていないが、我々はそれを検討している」

もし彼らが2012年にそれを探していたら、確かに何らかのアプローチがあります...私の要求は、現在GoogleのAPIにアクセスするだけです。ですから、ACCESS_TYPE =オフラインを選択することができますし、アカウントチューURLを続けるGoogleのOAuthの遊び場の流れを比較

は...あなたはACCESS_TYPEののparamaterを見ることができます。この

https://accounts.google.com/AccountChooser?continue=https://accounts.google.com/o/oauth2/auth? 
access_type=offline 
&approval_prompt=force 
&scope=https://www.googleapis.com/auth/cloudprint+https://www.googleapis.com/auth/userinfo.profile 
&response_type=code 
&redirect_uri=https://developers.google.com/oauthplayground 
&client_id=407408718192.apps.googleusercontent.com 
&hl=en-GB 
&from_login=1 
&as=5cc2df3c88f13395 
&ltmpl=popup 
&btmpl=authsub 
&hl=en_GB 
&scc=1 
&oauth=1 

のように見えます。 gitkit-debug.jsにいくつかの追加の設定プロパティを追加し、POSTが送信されるまで関数の実行をトレースしました。新しいパラメータが送信されるまでデータ内にあります彼らに

screeenshot of debug console showing data object state just before POST

マイ結果のURLが含まれていないURLがなぜどのようにACCESS_TYPE =オフラインが削除され、パラメータがこの

https://accounts.google.com/AccountChooser?continue=https://accounts.google.com/o/oauth2/auth? 
scope=https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/cloudprint+https://www.googleapis.com/auth/userinfo.profile+openid 
&response_type=token+code+id_token+gsession 
&redirect_uri=http://localhost:8080/identity/control/authenticate 
&state=AFD_5tmV........... etc 
&client_id=143312559437-4o93ranlfalg78rj006qirib182bnkj4.apps.googleusercontent.com 
&include_profile=true 
&hl=en-GB 
&from_login=1 
&as=77237587f41849c5 
&ltmpl=popup 
&btmpl=authsub 
&hl=en_GB 
&scc=1 
&oauth=1 

のように見え続けますか?

答えて

0
gitkit.widget.handler.onProviderSignInIdpClick_ = function(app, component, idp) { 
    //null values are removed later in requestGitkitEndpoint 
    //not sure if extra paramaters are needed in the Request 
    var request = { 
    providerId: idp.getProviderId(), 
    continueUri: app.getConfig().getIdpCallbackUrl(), 
    oauthScope: app.getConfig().getIdpConfigAdditionalScopes(), 
    access_type: app.getConfig().getAccessType(), 
    approval_prompt: app.getConfig().getApprovalPrompt() 
    }; 
    //the request is then parsed into the executor within component.executeRequest 
    component.executeRequest(
    //executor 
    goog.bind(app.getApi().createAuthUri, app.getApi()), 
    //request 
    request, 
    //cb 
    function(resp) { 
     if (!resp || gitkit.api.hasError(resp)) { 
     (gitkit.log.error("createAuthUri: " + goog.json.serialize(resp)), component.showInfoBar(gitkit.widget.handler.common.getErrorMessage(gitkit.api.getErrorCode(resp)))) 
     } else { 
     if(resp.providerId === 'google.com'){ 
      var append = null; 
      if (goog.isDefAndNotNull(app.getConfig().getAccessType())) { 
      var paramValue = goog.string.urlEncode(app.getConfig().getAccessType()); 
      append = "&access_type=" + paramValue; 
      } 
      if (goog.isDefAndNotNull(app.getConfig().getApprovalPrompt())) { 
      var paramValue = goog.string.urlEncode(app.getConfig().getApprovalPrompt()); 
      if(append) append = append.concat("&approval_prompt=" + paramValue); 
      else append = "&approval_prompt=" + paramValue 
      } 
      if(append){ 
      resp.authUri = resp.authUri.concat(append); 
      } 
     } 
     resp.sessionId && gitkit.storage.setSessionId(resp.sessionId, app.getAppId()), 
      gitkit.storage.setRememberAccount(!1, app.getAppId()), 
      gitkit.util.goTo(goog.asserts.assert(resp.authUri)); 
     } 
    }); 
}; 
関連する問題