Skip to content

Commit 5e13f52

Browse files
authored
feat:auth sdk aupport apple login (#595)
1 parent 8adcfc0 commit 5e13f52

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpTypes.cs

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ public enum ThirdPartyIdpTypes
99
WeChat = 2,
1010
GitHub = 3,
1111
Ldap = 4,
12+
Apple = 5
1213
}

src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpModel.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ public class LoginByThirdPartyIdpModel
1313

1414
public string Scheme { get; set; }
1515

16-
public string Code { get; set; } = "";
16+
public string? Code { get; set; }
17+
18+
public string? IdToken { get; set; }
1719
}

src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdpModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class ThirdPartyIdpModel
2929

3030
public string UserInformationEndpoint { get; set; } = "";
3131

32-
public bool MapAll { get; private set; }
32+
public bool MapAll { get; set; }
3333

3434
public Dictionary<string, string> JsonKeyMap { get; set; } = new();
3535
}

src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/LoginService.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public async Task<LoginByThirdPartyIdpResultModel> LoginByThirdPartyIdpAsync(Log
5959
["grant_type"] = GrantType.THIRD_PARTY_IDP,
6060
["scope"] = string.Join(' ', login.Scope),
6161
["scheme"] = login.Scheme,
62-
["code"] = login.Code
62+
["code"] = login.Code ?? "",
63+
["idToken"] = login.IdToken ?? "",
6364
};
6465

6566
var tokenResponse = await RequestTokenRawAsync(client, paramter);

0 commit comments

Comments
 (0)