2017-03-13 1 views
0

私は私のIdentityServer3エラー:invalid_scope - IdeneityServer Flow.ClientCredential

new Client 
{ 
    ClientName = "Client Credentials Flow Client", 
    Enabled = true, 
    ClientId = "clientcredentials.reference", 
    Flow = Flows.ClientCredentials, 

    ClientSecrets = new List<Secret> 
    { 
     new Secret("secret".Sha256()), 
    }, 

    AllowedScopes = new List<string>() 
    { 
     "read", 
     "write" 
    } 
} 

のクライアントを抱えている私は私の地元のIISでトークンサービスをホストされていると私はポストマンを使用してトークンにpingを実行しようとしたが、それは与えられましたエラー{"error":"invalid_scope"}

Host URL: 
    https://localhost:5775/core/connect/token 
Header: 
    Content-Type:application/x-www-form-urlencoded 
Body: 
    grant_type=client_credentials 
    &cliend_id=clientcredentials.reference 
    &client_secret=secret 

enter image description here

Note: I'm using pure IdentityServer3 package not Thinktecture

答えて

0

CHECスコープをk個...一度

それを確認してください...私はその逃したと思う

new Scope 
{ 
    Name = "read", 
    DisplayName = "Read data", 
    Type = ScopeType.Resource, 
    Emphasize = false, 

    ScopeSecrets = new List<Secret> 
    { 
     new Secret("secret".Sha256()) 
    } 
}, 
new Scope 
{ 
    Name = "write", 
    DisplayName = "Write data", 
    Type = ScopeType.Resource, 
    Emphasize = true, 

    ScopeSecrets = new List<Secret> 
    { 
     new Secret("secret".Sha256()) 
    } 
} 

スコープ宣言で「読み取り」と「書き込み」

関連する問題