-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update use-cases for interactive webassembly
- Loading branch information
Showing
4 changed files
with
117 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
Back to [Use Cases](../04.use-cases.md) | ||
|
||
> ⚠️ | ||
> This section is a work in progress. | ||
## Interactive Server | ||
|
||
The following sequence diagrams illustrate the use cases for Blazor.Auth in a Blazor application that is currently using interactive WebAssembly render mode: | ||
|
||
### Sign-In | ||
|
||
```mermaid | ||
sequenceDiagram | ||
actor user as User | ||
participant page as SignIn Page | ||
participant userService as IUserService | ||
participant authService as IAuthenticationService | ||
user ->>+ page: Submit Sign-In Form | ||
page ->>+ userService: SignInAsync(signInPayload) | ||
userService ->>+ authService: SignInAsync(signInPayload) | ||
authService ->> authService: Your sign-in logic | ||
authService -->>- userService: AuthenticationResult | ||
userService ->> userService: Update Browser Cookies | ||
userService -->>- page: AuthenticationResult | ||
page -->>- user: Redirect to home page | ||
note over user,userService: Upon receiving AuthenticationResult from IUserService, <br/> do a page refresh in order to refresh the User's AuthenticationState<br/><br/> Example: NavigationManager.NavigateTo("/", true) | ||
``` | ||
|
||
### Sign-Up | ||
|
||
```mermaid | ||
sequenceDiagram | ||
actor user as User | ||
participant page as SignIn Page | ||
participant userService as IUserService | ||
participant authService as IAuthenticationService | ||
user ->>+ page: Submit Sign-Up Form | ||
page ->>+ userService: SignUpAsync(signUpPayload) | ||
userService ->>+ authService: SignUpAsync(signUpPayload) | ||
authService ->> authService: Your sign-up logic | ||
authService -->>- userService: AuthenticationResult | ||
userService ->> userService: Update Browser Cookies | ||
userService -->>- page: AuthenticationResult | ||
page -->- user: Redirect to home page | ||
note over user,userService: Upon receiving AuthenticationResult from IUserService, <br/> do a page refresh in order to refresh the User's AuthenticationState<br/><br/> Example: NavigationManager.NavigateTo("/", true) | ||
``` | ||
|
||
### Refresh Token | ||
|
||
```mermaid | ||
sequenceDiagram | ||
actor user as User | ||
participant page as Page | ||
participant lib as Blazor.Auth | ||
participant userService as IUserService | ||
participant authService as IAuthenticationService | ||
user ->>+ page: Open Page | ||
page ->>+ lib: Get User's AuthenticationState | ||
lib ->>+ userService: If AccessToken expired,\nRefreshJwtPairAsync | ||
userService ->>+ authService: RefreshJwtPairAsync | ||
authService ->> authService: Your refresh logic | ||
authService -->>- userService: AuthenticationResult | ||
userService ->> userService: Update Browser Cookies | ||
userService -->>- lib: AuthenticationResult | ||
lib -->>- page: AuthenticationState | ||
page -->>- user: Display Page | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters