2015-05-21 62 views
3

我使用mvc客戶端的教程構建了一個IdentityServer。 http://identityserver.github.io/Documentation/docs/overview/simplestOAuth.html 的IdentityServer正常工作與MVC的客戶端,但我使用的是JavaScript客戶端,所以我下載的JavaScript樣本:Javscript隱客戶: https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/Clients/JavaScriptImplicitClient無法從JavaScript客戶端訪問Thinktecture IdentityServer3上的登錄

當我嘗試從客戶端登錄,它總是回來「 客戶端應用程序不知道或不批准。」

有人點我在正確的方向?有沒有一種方法來打開日誌記錄,看看爲什麼客戶端被拒絕?

相關的JavaScript代碼:

var config = { 
     authority: "https://localhost:44302/identity", 
     client_id: "mws", 
     redirect_uri: window.location.protocol + "//" + window.location.host + "/index.html", 
     post_logout_redirect_uri: window.location.protocol + "//" + window.location.host + "/index.html", 

     // these two will be done dynamically from the buttons clicked 
     //response_type: "id_token token", 
     //scope: "openid profile email read write", 

     // we're not using these in this sample 
     silent_redirect_uri: window.location.protocol + "//" + window.location.host + "/silent_renew.html", 
     //silent_renew: true, 

     // this will allow all the OIDC protocol claims to vbe visible in the window. normally a client app 
     // wouldn't care about them or want them taking up space 
     filter_protocol_claims: false 
    }; 

服務器端客戶機定義:

new Client 
      { 
       Enabled = true, 
       ClientName = "Manager Workstation", 
       ClientId = "mws", 
       Flow = Flows.Hybrid, 
       RequireConsent = true, 
       RedirectUris = new List<string> 
       { 
        "https://localhost:44303/index.html" 
       },  
       PostLogoutRedirectUris = new List<string> 
       { 
        "https://localhost:44303/index.html" 
       } 
      }, ... 

回答

2

我得到它的工作。問題出在服務端的「Flow = Flows.Hybrid」應該是「Flow = Flows.Implicit」

相關問題