2017-05-12 13 views
0

私はサンドボックスでPayPalでログインするスパイクを構築しようとしています。私は、このhttp://www.cloudidentity.com/blog/2014/07/24/protecting-an-asp-net-webforms-app-with-openid-connect-and-azure-ad/に基づいてMicrosoft.Owin.Security.OpenIdConnectを使用しています。PayPal OpenId Connectサンドボックスメタデータアドレス

public void ConfigureAuth(IAppBuilder app) 
    { 
     app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); 
     app.UseCookieAuthentication(new CookieAuthenticationOptions()); 

     app.UseOpenIdConnectAuthentication(
      new OpenIdConnectAuthenticationOptions 
      { 

       ClientId = "my test clientid", 
       RedirectUri = "http://localhost:50625", 
       Scope = "openid profile email address phone", 
       Authority = "https://www.sandbox.paypal.com/signin/authorize", 
       MetadataAddress = "https://www.paypalobjects.com/.well-known/openid-configuration" 

      }); 

問題はMetadataAddressです。

私は https://www.paypalobjects.com/.well-known/openid-configuration にMetadataAddressを設定すると、設定は、ライブのためである、と私はに送信されます承認URLはサンドボックスではなく、私のクライアントのことを聞いたことがない

https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=etc

ですid &はエラーをスローします。私はその後、バックボタンを押すと、それは動作します

https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=etc

にURLを変更します。

しかし、私は

  1. その後、最初の場所で

    http://www.sandbox.paypal.com/.well-known/openid-configuration

    にMetadataAddressを設定している場合、私は、要求が中止されましたエラー」を得る:SSL/TLSのセキュリティで保護されたチャネルを作成できませんでしたが。 "

  2. sandbox.paypal.comのファイルは、ライブファイルと同じ設定になっています。

Log In with PayPalサンドボックスの.well-known/openid設定の正しいURLは何ですか?

+0

私はちょうどサンドボックスにログインしていない間にリブートした後http://www.sandbox.paypal.com/.well-known/openid-configurationに行き、ログインページにリダイレクトされました。だからそれはエラー(1)の原因かもしれません。私がそれに達することができても、ファイルは他のファイルと同じです。私は自分自身をホストすることができると思うが、それは精神的なようだ。 –

答えて

0

私は.well知ら/ openidの-構成を使用していないようですが、次のしている私は

https://github.com/TerribleDev/OwinOAuthProviders

からOwin.Security.Providers.PayPalを使用して必要な答えを見つけましたその中の終点。

private const string AuthorizationEndPoint = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize"; 
    private const string TokenEndpoint = "https://api.paypal.com/v1/identity/openidconnect/tokenservice"; 
    private const string UserInfoEndpoint = "https://api.paypal.com/v1/identity/openidconnect/userinfo/?schema=openid"; 

    private const string SandboxAuthorizationEndPoint = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize"; 
    private const string SandboxTokenEndpoint = "https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice"; 
    private const string SandboxUserInfoEndpoint = "https://api.sandbox.paypal.com/v1/identity/openidconnect/userinfo/?schema=openid"; 

私は最終的に私のサンドボックスアカウントでログインを取得するように管理しました。同じことを試みる他の誰のための

注:まず

を、それが第二The request was aborted: Could not create SSL/TLS secure channel sandbox account

の、戻りURLがアプリに設定するため、いくつかの点で

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; 

を設定する必要がありますPayPalの設定は、生成されたWHOLEコールバックURL(ドメイン名だけでなく)でなければなりません。実際に何が起こるかはあなたには言えません...デフォルトは

http://localhost[:$port]/signin-paypal 
関連する問題