Skip to content

Commit bbd10f4

Browse files
committed
Reviewed Flow Client API
1 parent 9056fdf commit bbd10f4

File tree

61 files changed

+190
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+190
-230
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ app.MapRazorComponents<App>()
186186
```
187187

188188
### 4) Add UAuth Script
189-
Place this in `App.razor` or `index.html`
189+
Place this in `App.razor` or `index.html` in your Blazor client application:
190190
```csharp
191191
<script src="_content/CodeBeam.UltimateAuth.Client.Blazor/uauth.min.js"></script>
192192
```
@@ -281,7 +281,7 @@ LogoutAll But Keep Current Device
281281

282282
private async Task LogoutOthersAsync()
283283
{
284-
var result = await UAuthClient.Flows.LogoutOtherDevicesSelfAsync();
284+
var result = await UAuthClient.Flows.LogoutMyOtherDevicesAsync();
285285
Console.WriteLine(result.IsSuccess);
286286
}
287287
```

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Dialogs/SessionDialog.razor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ private async Task LogoutAllAsync()
118118

119119
if (UserKey is null)
120120
{
121-
result = await UAuthClient.Flows.LogoutAllDevicesSelfAsync();
121+
result = await UAuthClient.Flows.LogoutAllMyDevicesAsync();
122122
}
123123
else
124124
{
125-
result = await UAuthClient.Flows.LogoutAllDevicesAdminAsync(UserKey.Value);
125+
result = await UAuthClient.Flows.LogoutAllUserDevicesAsync(UserKey.Value);
126126
}
127127

128128
if (result.IsSuccess)
@@ -139,7 +139,7 @@ private async Task LogoutAllAsync()
139139

140140
private async Task LogoutOthersAsync()
141141
{
142-
var result = await UAuthClient.Flows.LogoutOtherDevicesSelfAsync();
142+
var result = await UAuthClient.Flows.LogoutMyOtherDevicesAsync();
143143

144144
if (result.IsSuccess)
145145
{
@@ -158,11 +158,11 @@ private async Task LogoutDeviceAsync(SessionChainId chainId)
158158

159159
if (UserKey is null)
160160
{
161-
result = await UAuthClient.Flows.LogoutDeviceSelfAsync(request);
161+
result = await UAuthClient.Flows.LogoutMyDeviceAsync(request);
162162
}
163163
else
164164
{
165-
result = await UAuthClient.Flows.LogoutDeviceAdminAsync(UserKey.Value, request);
165+
result = await UAuthClient.Flows.LogoutUserDeviceAsync(UserKey.Value, request);
166166
}
167167

168168
if (result.IsSuccess)

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Components/Dialogs/SessionDialog.razor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ private async Task LogoutAllAsync()
118118

119119
if (UserKey is null)
120120
{
121-
result = await UAuthClient.Flows.LogoutAllDevicesSelfAsync();
121+
result = await UAuthClient.Flows.LogoutAllMyDevicesAsync();
122122
}
123123
else
124124
{
125-
result = await UAuthClient.Flows.LogoutAllDevicesAdminAsync(UserKey.Value);
125+
result = await UAuthClient.Flows.LogoutAllUserDevicesAsync(UserKey.Value);
126126
}
127127

128128
if (result.IsSuccess)
@@ -139,7 +139,7 @@ private async Task LogoutAllAsync()
139139

140140
private async Task LogoutOthersAsync()
141141
{
142-
var result = await UAuthClient.Flows.LogoutOtherDevicesSelfAsync();
142+
var result = await UAuthClient.Flows.LogoutMyOtherDevicesAsync();
143143

144144
if (result.IsSuccess)
145145
{
@@ -158,11 +158,11 @@ private async Task LogoutDeviceAsync(SessionChainId chainId)
158158

159159
if (UserKey is null)
160160
{
161-
result = await UAuthClient.Flows.LogoutDeviceSelfAsync(request);
161+
result = await UAuthClient.Flows.LogoutMyDeviceAsync(request);
162162
}
163163
else
164164
{
165-
result = await UAuthClient.Flows.LogoutDeviceAdminAsync(UserKey.Value, request);
165+
result = await UAuthClient.Flows.LogoutUserDeviceAsync(UserKey.Value, request);
166166
}
167167

168168
if (result.IsSuccess)

samples/blazor-standalone-wasm/CodeBeam.UltimateAuth.Sample.BlazorStandaloneWasm/Components/Dialogs/SessionDialog.razor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ private async Task LogoutAllAsync()
120120

121121
if (UserKey is null)
122122
{
123-
result = await UAuthClient.Flows.LogoutAllDevicesSelfAsync();
123+
result = await UAuthClient.Flows.LogoutAllMyDevicesAsync();
124124
}
125125
else
126126
{
127-
result = await UAuthClient.Flows.LogoutAllDevicesAdminAsync(UserKey.Value);
127+
result = await UAuthClient.Flows.LogoutAllUserDevicesAsync(UserKey.Value);
128128
}
129129

130130
if (result.IsSuccess)
@@ -141,7 +141,7 @@ private async Task LogoutAllAsync()
141141

142142
private async Task LogoutOthersAsync()
143143
{
144-
var result = await UAuthClient.Flows.LogoutOtherDevicesSelfAsync();
144+
var result = await UAuthClient.Flows.LogoutMyOtherDevicesAsync();
145145

146146
if (result.IsSuccess)
147147
{
@@ -160,11 +160,11 @@ private async Task LogoutDeviceAsync(SessionChainId chainId)
160160

161161
if (UserKey is null)
162162
{
163-
result = await UAuthClient.Flows.LogoutDeviceSelfAsync(request);
163+
result = await UAuthClient.Flows.LogoutMyDeviceAsync(request);
164164
}
165165
else
166166
{
167-
result = await UAuthClient.Flows.LogoutDeviceAdminAsync(UserKey.Value, request);
167+
result = await UAuthClient.Flows.LogoutUserDeviceAsync(UserKey.Value, request);
168168
}
169169

170170
if (result.IsSuccess)

src/CodeBeam.UltimateAuth.Core/Abstractions/Issuers/ISessionIssuer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace CodeBeam.UltimateAuth.Core.Abstractions;
66

77
public interface ISessionIssuer
88
{
9-
Task<IssuedSession> IssueSessionAsync(AuthenticatedSessionContext context, CancellationToken cancellationToken = default);
9+
Task<IssuedSession> IssueSessionAsync(SessionIssuanceContext context, CancellationToken cancellationToken = default);
1010

1111
Task<IssuedSession> RotateSessionAsync(SessionRotationContext context, CancellationToken cancellationToken = default);
1212

src/CodeBeam.UltimateAuth.Core/Contracts/Access/AccessScope.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
public enum ActionScope
44
{
5-
Anonymous,
6-
Self,
7-
Admin,
8-
System
5+
Anonymous = 0,
6+
Self = 10,
7+
Admin = 20,
8+
System = 30
99
}

src/CodeBeam.UltimateAuth.Core/Contracts/Authority/AuthOperation.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
public enum AuthOperation
44
{
5-
Login,
6-
Access,
7-
ResourceAccess,
8-
Refresh,
9-
Revoke,
10-
Logout,
11-
System
5+
Login = 0,
6+
Access = 10,
7+
ResourceAccess = 20,
8+
Refresh = 30,
9+
Revoke = 40,
10+
Logout = 50,
11+
System = 100,
1212
}

src/CodeBeam.UltimateAuth.Core/Contracts/Authority/AuthorizationDecision.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public enum AuthorizationDecision
44
{
5-
Allow,
6-
Deny,
7-
Challenge
5+
Allow = 0,
6+
Deny = 10,
7+
Challenge = 20
88
}

src/CodeBeam.UltimateAuth.Core/Contracts/Authority/DeviceMismatchBehavior.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public enum DeviceMismatchBehavior
44
{
5-
Reject,
6-
Allow,
7-
AllowAndRebind
5+
Reject = 0,
6+
Allow = 10,
7+
AllowAndRebind = 20
88
}

src/CodeBeam.UltimateAuth.Core/Contracts/Common/CaseHandling.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public enum CaseHandling
44
{
5-
Preserve,
6-
ToLower,
7-
ToUpper
5+
Preserve = 0,
6+
ToLower = 10,
7+
ToUpper = 20
88
}

0 commit comments

Comments
 (0)