I'm trying to build a spike that uses Log In with PayPal in the sandbox. I'm using Microsoft.Owin.Security.OpenIdConnect based on this http://www.cloudidentity.com/blog/2014/07/24/protecting-an-asp-net-webforms-app-with-openid-connect-and-azure-ad/ for want of a better example.
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"
});
The problem is the MetadataAddress.
If I set the MetadataAddress to https://www.paypalobjects.com/.well-known/openid-configuration then the configuration is for live, and the authorisation URL I get sent to is
https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=etc
which is not the sandbox and has never heard of my client id & throws an error. If I then press the back button, change the url to
https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=etc
then it works.
But if I set the MetadataAddress to
http://www.sandbox.paypal.com/.well-known/openid-configuration
in the first place then
- I get an error "The request was aborted: Could not create SSL/TLS secure channel."
- That file at sandbox.paypal.com has the same config as the live file anyway.
What is the correct url for the .well-known/openid-configuration for the Log In with PayPal sandbox?