Ends in:
7 DAYS
10 HRS
27 MIN
20 SEC
Ends in:
7 D
10 H
27 M
20 S
Open Closed

Apple as External Provider #2751


User avatar
0
shobhit created
  • ABP Framework version: v4.2.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

hi Team, Please confirm if identity server supports apple as external auth provider. If yes, how i can enable it. Please share nuget package reference to add (if any) and code changes to be done.


6 Answer(s)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    https://docs.abp.io/en/commercial/latest/modules/account#social-external-logins

    The application startup template comes with Twitter, Google and Microsoft logins pre-installed.


    This question does not appear to be related to ABP.

    Here is a quote from Microsoft's article about external providers:

    Facebook, Twitter, Google, and Microsoft providers are covered in the following sections and use the starter project created in this article. Other providers are available in third-party packages such as AspNet.Security.OAuth.Providers and AspNet.Security.OpenId.Providers.

    AspNet.Security.OAuth.Providers package supports Apple provider and I think you can use it easily.

    For instance:

    services.AddAuthentication(options => { /* Authentication options */ })
             .AddApple(options =>
             {
                ....
             });
    

    For more information see here.

  • User Avatar
    0
    shobhit created

    Hello @berkansasmaz, Thanks a lot for your help. it helped me but now i stuck again. Please help me.

        We are building SaaS based product and apple provider details will change for each tenant. So i am using the ABP way of configuring the external provider. 
        Below changes i have done in "Identity server --> module" class. Now i have 2 question:
        
    

    1- is the below implementation correct as per ABP syntex

    .AddApple(AppleAuthenticationDefaults.AuthenticationScheme, _ => { }) .WithDynamicOptions<AppleAuthenticationOptions, AppleAuthenticationHandler>(AppleAuthenticationDefaults.AuthenticationScheme, options => { options.WithProperty(x => x.ClientId); options.WithProperty(x => x.KeyId); options.WithProperty(x => x.TeamId); options.WithProperty(x => x.UsePrivateKey((keyId) => provider.GetFileInfo($"AuthKey_{keyId}.p8")));
    }) 2- in UsePrivateKey can i assign byte string directly

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The UsePrivateKey need to be Secret .WithProperty(x => x.UsePrivateKey, isSecret: true);

    2- in UsePrivateKey can i assign byte string directly

    If this value is constant you don't need to call WithProperty for it. See https://docs.abp.io/en/commercial/latest/modules/account#social-external-logins

  • User Avatar
    0
    shobhit created

    UsePrivateKey is showing error:

  • User Avatar
    0
    shobhit created

    just to mention we are using following apple package

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    UsePrivateKey is a method, not property. WithProperty only works for string properties.

    You can override this service to use different AppleClientSecretfor different tenants.

    https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/blob/990f1bbfdbe1716e1c2bb03722b67b9a24225c4a/src/AspNet.Security.OAuth.Apple/Internal/DefaultAppleClientSecretGenerator.cs#L15

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06