-
Notifications
You must be signed in to change notification settings - Fork 450
add DynamicTokenProvider. #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2b7f860
add DynamicTokenProvider.
8ba7246
修正Dictionary相关。
23f3f66
修正AddOrUpdate方法
ba35b37
变更 OAuthTokenKey 方式
d0ca4b1
更新 OAuthTokenKey
c4f71b5
修正 TokenProvider
87ce40d
修正 TokenProvider
d048f8c
修正 tokenprovider
e894131
修正 ITokenProvider
cdbdec0
修改 TokenResult,增加 refresh_expires_in 属性
a0a0657
Merge branch 'master' into Branch_DynamicToken
14dfcdc
修复 TokenProvider 刷新Token
8302669
添加 模拟 多APP Demo
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
19 changes: 19 additions & 0 deletions
WebApiClientCore.Extensions.OAuths/Attributes/OAuthTokenKeyAttribute.cs
This file contains hidden or 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,19 @@ | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace WebApiClientCore.Attributes | ||
| { | ||
| /// <summary> | ||
| /// 动态应用标识 | ||
| /// </summary> | ||
| public class OAuthTokenKeyAttribute : ApiParameterAttribute | ||
| { | ||
| /// <summary> | ||
| /// http请求之前 | ||
| /// </summary> | ||
| public override Task OnRequestAsync(ApiParameterContext context) | ||
| { | ||
| context.Properties.Set(typeof(OAuthTokenAttribute), context.ParameterValue); | ||
| return Task.CompletedTask; | ||
| } | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
WebApiClientCore.Extensions.OAuths/Exceptions/TokenIdentifierException.cs
This file contains hidden or 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,37 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace WebApiClientCore.Extensions.OAuths.Exceptions | ||
| { | ||
| /// <summary> | ||
| /// 表示Token 应用标识异常 | ||
| /// </summary> | ||
| public class TokenIdentifierException : Exception | ||
| { | ||
| /// <summary> | ||
| /// Token异常 | ||
| /// </summary> | ||
| /// <param name="message">消息</param> | ||
| public TokenIdentifierException(string? message) | ||
| : base(message) | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// 表示Token 应用标识异常 | ||
| /// </summary> | ||
| public TokenIdentifierException() | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// 表示Token 应用标识异常 | ||
| /// </summary> | ||
| /// <param name="message">The error message that explains the reason for the exception.</param> | ||
| /// <param name="innerException">The exception that is the cause of the current exception, or a null reference (<see langword="Nothing" /> in Visual Basic) if no inner exception is specified.</param> | ||
| public TokenIdentifierException(string message, Exception innerException) : base(message, innerException) | ||
| { | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.