首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PayPal OpenId连接沙箱元数据地址

PayPal OpenId连接沙箱元数据地址
EN

Stack Overflow用户
提问于 2017-05-12 21:50:42
回答 1查看 298关注 0票数 0

我正在尝试构建一个在沙箱中使用登录与PayPal的尖峰。由于缺少一个更好的示例,我使用了基于这个Microsoft.Owin.Security.OpenIdConnect的http://www.cloudidentity.com/blog/2014/07/24/protecting-an-asp-net-webforms-app-with-openid-connect-and-azure-ad/

代码语言:javascript
复制
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。

如果我将MetadataAddress设置为https://www.paypalobjects.com/.well-known/openid-configuration,那么配置是针对活动的,并且发送到的授权URL是

id=etc

这不是沙箱,从来没有听说过我的客户端id &抛出错误。如果然后按后退按钮,请将url更改为

id=etc

那就成功了。

但是如果我将MetadataAddress设置为

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

那么,首先

  1. 我得到一个错误“请求被中止:无法创建SSL/TLS安全通道。
  2. 无论如何,sandbox.paypal.com上的文件具有与活动文件相同的配置。

对于使用PayPal沙箱登录的.著名/openid配置,正确的url是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-15 15:10:24

通过使用Owin.Security.Providers.PayPal,我找到了我需要的答案

https://github.com/TerribleDev/OwinOAuthProviders

它似乎没有使用众所周知的/openid配置,但其中有以下几个端点。

代码语言:javascript
复制
    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";

最后,我用我的沙箱帐户登录。

给其他尝试相同事情的人的笔记:

首先,有必要设置

代码语言:javascript
复制
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

在某种程度上因为The request was aborted: Could not create SSL/TLS secure channel sandbox account

其次,您在PayPal中的App中配置的返回URL需要是生成的整个回调URL (而不仅仅是域名),而且它实际上没有告诉您它将是什么.默认情况是

代码语言:javascript
复制
http://localhost[:$port]/signin-paypal
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43946946

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档