locked
Does anyone know about setting up paypal OAuth ? RRS feed

  • Question

  • User-973886032 posted

    hi guys

    I noticed on MS website, there is no explicit option for paypal OAuth on here 

    https://docs.microsoft.com/en-us/aspnet/core/security/authentication/social/other-logins?view=aspnetcore-2.2

    I created my app on developer.paypal.com and added my clientid and clientsecret to my startup.cs file as this 

    I had installed paypal using package manager using 

    Install-Package AspNet.Security.OAuth.Paypal -Version 2.1.0
    //appsetting.json file
    
        "PayPal": {
          "ClientId": "Axxxxxxxxxxxxxxxxxxxxxxxxxx",
          "ClientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx-J"
        },
    
    
    ///and my startup.cs file 
    
    
     services.AddAuthentication(options =>
                {
                    options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                })
                     
                .AddPaypal(options => {
                  //  options.ClientId = "AxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxV7FO";
                  //   options.ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxJ";
               
                   options.ClientId = Configuration["Authentication:PayPal:ClientId"];
                     options.ClientSecret = Configuration["Authentication:PayPal:ClientSecret"];
                });

    I had tried 2 options, in yellow and using the configuration option and appsettings.json

    both throw the same error

    An unhandled exception occurred while processing the request.
    MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.Authentication.ClaimActionCollectionMapExtensions.MapCustomJson(Microsoft.AspNetCore.Authentication.OAuth.Claims.ClaimActionCollection, System.String, System.Func`2<Newtonsoft.Json.Linq.JObject,System.String>)'.
    AspNet.Security.OAuth.Paypal.PaypalAuthenticationOptions..ctor()
    TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.RuntimeTypeHandle.CreateInstance(RuntimeType type, bool publicOnly, bool wrapExceptions, ref bool canBeCached, ref RuntimeMethodHandleInternal ctor, ref bool hasNoDefaultCtor)
    Stack Query Cookies Headers Routing 
    MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.Authentication.ClaimActionCollectionMapExtensions.MapCustomJson(Microsoft.AspNetCore.Authentication.OAuth.Claims.ClaimActionCollection, System.String, System.Func`2<Newtonsoft.Json.Linq.JObject,System.String>)'.
    AspNet.Security.OAuth.Paypal.PaypalAuthenticationOptions..ctor()

    Thursday, September 12, 2019 10:08 PM

All replies