Skip to content

Commit 0e8354f

Browse files
committed
feat: windows pkce alpha
1 parent 133952a commit 0e8354f

File tree

15 files changed

+421
-87
lines changed

15 files changed

+421
-87
lines changed

sample/Assets/Scenes/Passport/SelectAuthMethod.unity

+6-6
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ MonoBehaviour:
206206
m_TargetGraphic: {fileID: 416242725}
207207
m_HandleRect: {fileID: 416242724}
208208
m_Direction: 0
209-
m_Value: 0
209+
m_Value: 1
210210
m_Size: 1
211211
m_NumberOfSteps: 0
212212
m_OnValueChanged:
@@ -1323,7 +1323,7 @@ MonoBehaviour:
13231323
m_TargetGraphic: {fileID: 167431872}
13241324
m_HandleRect: {fileID: 167431871}
13251325
m_Direction: 2
1326-
m_Value: 1
1326+
m_Value: 0
13271327
m_Size: 1
13281328
m_NumberOfSteps: 0
13291329
m_OnValueChanged:
@@ -1673,8 +1673,8 @@ RectTransform:
16731673
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
16741674
m_AnchorMin: {x: 0, y: 0}
16751675
m_AnchorMax: {x: 0, y: 0}
1676-
m_AnchoredPosition: {x: 1016.24, y: 0}
1677-
m_SizeDelta: {x: 1992.48, y: 0}
1676+
m_AnchoredPosition: {x: 841.51855, y: 0}
1677+
m_SizeDelta: {x: 1643.0371, y: 0}
16781678
m_Pivot: {x: 0.5, y: 0.5}
16791679
--- !u!114 &1661390145
16801680
MonoBehaviour:
@@ -1768,8 +1768,8 @@ RectTransform:
17681768
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
17691769
m_AnchorMin: {x: 0, y: 0}
17701770
m_AnchorMax: {x: 0, y: 0}
1771-
m_AnchoredPosition: {x: 1016.24, y: 0}
1772-
m_SizeDelta: {x: 1992.48, y: 0}
1771+
m_AnchoredPosition: {x: 841.51855, y: 0}
1772+
m_SizeDelta: {x: 1643.0371, y: 0}
17731773
m_Pivot: {x: 0.5, y: 0.5}
17741774
--- !u!114 &1688502349
17751775
MonoBehaviour:

sample/Assets/Scripts/Passport/AuthenticatedScript.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,9 @@ public async void Logout()
186186
try
187187
{
188188
// Logout using the appropriate logout method
189-
if (SampleAppManager.SupportsPKCE && SampleAppManager.UsePKCE)
189+
if (SampleAppManager.UsePKCE)
190190
{
191-
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX || UNITY_WEBGL
192191
await Passport.LogoutPKCE();
193-
#endif
194192
}
195193
else
196194
{

sample/Assets/Scripts/Passport/SampleAppManager.cs

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
public static class SampleAppManager
22
{
3-
/// <summary>
4-
/// Indicates whether the running platform supports PKCE.
5-
/// </summary>
6-
public static bool SupportsPKCE { get; set; }
7-
83
/// <summary>
94
/// Indicates whether the selected authentication method is PKCE.
105
/// </summary>

sample/Assets/Scripts/Passport/SelectAuthMethodScript.cs

-21
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,9 @@ public class SelectAuthMethodScript : MonoBehaviour
1616

1717
void Start()
1818
{
19-
// Determine if PKCE is supported based on the platform
20-
SampleAppManager.SupportsPKCE = IsPKCESupported();
21-
2219
// WebGL does not support Device Code Auth, so we'll use PKCE by default instead.
2320
#if UNITY_WEBGL
2421
UsePKCE();
25-
#else
26-
// If PKCE is not supported, initialise Passport to use Device Code Auth
27-
if (!SampleAppManager.SupportsPKCE)
28-
{
29-
UseDeviceCodeAuth();
30-
}
31-
#endif
32-
}
33-
34-
/// <summary>
35-
/// Checks if the current platform supports PKCE authentication.
36-
/// </summary>
37-
private bool IsPKCESupported()
38-
{
39-
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX || UNITY_WEBGL
40-
return true;
41-
#else
42-
return false;
4322
#endif
4423
}
4524

sample/Assets/Scripts/Passport/UnauthenticatedScript.cs

+3-9
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ public async void Login()
6767
try
6868
{
6969
// Login using the appropriate login method
70-
if (SampleAppManager.SupportsPKCE && SampleAppManager.UsePKCE)
70+
if (SampleAppManager.UsePKCE)
7171
{
72-
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX || UNITY_WEBGL
7372
await Passport.LoginPKCE();
74-
#endif
7573
}
7674
else
7775
{
@@ -109,11 +107,9 @@ public async void Connect()
109107
try
110108
{
111109
// Login and connect to IMX using the appropriate connect method
112-
if (SampleAppManager.SupportsPKCE && SampleAppManager.UsePKCE)
110+
if (SampleAppManager.UsePKCE)
113111
{
114-
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX || UNITY_WEBGL
115112
await Passport.ConnectImxPKCE();
116-
#endif
117113
}
118114
else
119115
{
@@ -206,11 +202,9 @@ private async UniTask Logout()
206202
try
207203
{
208204
// Logout using the appropriate logout method
209-
if (SampleAppManager.SupportsPKCE && SampleAppManager.UsePKCE)
205+
if (SampleAppManager.UsePKCE)
210206
{
211-
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX || UNITY_WEBGL
212207
await Passport.LogoutPKCE();
213-
#endif
214208
}
215209
else
216210
{

src/Packages/Passport/Private.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Packages/Passport/Private/Helpers.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)