This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from DuendeSoftware/joe/tokens-in-auth-proper…
…ties Add service for storage of tokens in auth properties
- Loading branch information
Showing
9 changed files
with
709 additions
and
165 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
36 changes: 36 additions & 0 deletions
36
src/Duende.AccessTokenManagement.OpenIdConnect/IStoreTokensInAuthenticationProperties.cs
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,36 @@ | ||
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. | ||
|
||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Authentication; | ||
|
||
namespace Duende.AccessTokenManagement.OpenIdConnect; | ||
|
||
/// <summary> | ||
/// Interface that encapsulates the logic of storing UserTokens in AuthenticationProperties | ||
/// </summary> | ||
public interface IStoreTokensInAuthenticationProperties | ||
{ | ||
/// <summary> | ||
/// Gets a UserToken from the AuthenticationProperties | ||
/// </summary> | ||
UserToken GetUserToken(AuthenticationProperties authenticationProperties, UserTokenRequestParameters? parameters = null); | ||
|
||
/// <summary> | ||
/// Sets a UserToken in the AuthenticationProperties. | ||
/// </summary> | ||
void SetUserToken(UserToken token, AuthenticationProperties authenticationProperties, UserTokenRequestParameters? parameters = null); | ||
|
||
/// <summary> | ||
/// Removes a UserToken from the AuthenticationProperties. | ||
/// </summary> | ||
/// <param name="authenticationProperties"></param> | ||
/// <param name="parameters"></param> | ||
void RemoveUserToken(AuthenticationProperties authenticationProperties, UserTokenRequestParameters? parameters = null); | ||
|
||
/// <summary> | ||
/// Gets the scheme name used when storing a UserToken in an | ||
/// AuthenticationProperties. | ||
/// </summary> | ||
Task<string> GetSchemeAsync(UserTokenRequestParameters? parameters = null); | ||
} |
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
Oops, something went wrong.