4

我想使用使用Java腳本(無Java Servlet)端點的GAE開放式ID聯合身份驗證。使用Java腳本端點的GAE開放式ID聯合身份驗證

它是否支持通過Java腳本(無Java Servlet)終點? 如果是,我怎樣才能使用Open Script ID聯合認證和Java Script端點API調用?在端點API

我曾試圖用戶

@ApiMethod(
     name = "signMe.signGoogleId", 
     httpMethod = "POST", 
     scopes = { "https://www.googleapis.com/auth/userinfo.profile" , "https://www.googleapis.com/auth/userinfo.email" } 
    ) 
    public SignIn signInOpenId(User user)throws 
     OAuthRequestException, IOException 
    { 

     User is null always even after logging with Google\Yahoo User. 

我曾試圖在端點API HttpServletRequest的REQ。

@ApiMethod(
     name = "SignMe.signOpenId", 
     httpMethod = HttpMethod.GET, 
     scopes = { "https://www.googleapis.com/auth/userinfo.profile" , "https://www.googleapis.com/auth/userinfo.email" } 
    ) 
    public SignIn signInOpenId(HttpServletRequest req) 
    throws IOException 
{ 

UserService userService = UserServiceFactory.getUserService(); 
     User newUser = userService.getCurrentUser(); 

     newUser is null always even after logging with Google\Yahoo User. 

感謝, 迪帕克

+0

我面臨同樣的問題。有沒有人使用具有聯邦登錄選項的雲終端? – Ashish

回答

0

你總是可以轉儲做的雲終端的方式和一般API認證去。

https://developers.google.com/appengine/articles/openid#fa

正如非雲端點應用來完成。缺點是你不會得到任何客戶授權能力,所以任何客戶端代碼都會觸發你的API。

Google Cloud Endpoints目前OAuth似乎不支持Open ID。

相關問題