2016-10-05 5 views
1

auth0.net(Auth0 APIの.NETクライアント)を使用して認証しようとしていますが、Auth0.Core.Exceptions.ApiExceptionというエラーとHTTPステータスコードNotFound (404)が発生します。ここで間違っている何auth0.netを使用して認証APIを呼び出すときに404を取得する

var client = new AuthenticationApiClient(new Uri(Auth0Url)); 

var authenticationRequest = new AuthenticationRequest(); 
authenticationRequest.ClientId = ClientId; 
authenticationRequest.Username = username; 
authenticationRequest.Password = password; 
authenticationRequest.Connection = "Username-Password-Authentication"; 

AuthenticationResponse response = null; 
Task.Run(async() => 
{ 
    response = await client.AuthenticateAsync(authenticationRequest); 
}).Wait(); 

私は、次のコードを使用していますか?管理APIは正常に動作し、ClientIDは正しいです。

+1

'Auth0Url'変数の内容は何ですか?公開したくない場合は、ドメイン内のテナント名の部分を省略/変更することができます。 –

+1

@João、とても良い質問です!私には恥ずべき!管理APIで使用されているものと同じでなければなりません。 – amuliar

答えて

1

自分でこの問題が発生しました。

2つのもの。

まずは、あなたが正しいAPIのURLを使用していることを確認してください。

など。

https://<company>.au.auth0.com/api/v2

そしてない https://<company>.au.auth0.com

セカンドあなたは基本API

例えばを使用していることを確認し

https://<company>.au.auth0.com/api/v2

そしてない https://<company>.au.auth0.com/api/v2/users

関連する問題