- 
  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
Conversation
Signed-off-by: Vicente Yu <^@^>
Signed-off-by: Vicente.Yu <^@^>
Signed-off-by: Vicente.Yu <^@^>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IgnoreAttribute可以和WDynamicTokenAttribute合并,参考HeaderAttribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequestTokenAsync可能需要携带identifier参数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RefreshTokenAsync可能需要携带identifier参数?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RefreshTokenAsync 按理不用,是以token换token。
这个接口的设计,与原体系偏离了,没有能够利用起ITokenProviderFactory的功能。
要实现一个TokenProvider支持多个以key来区分的token,只需要参考DI的Key模式,为ITokenProvider增加 void ClearToken(sting Key);和Task<TokenResult> GetTokenAsync(string key);即可。
这个接口的设计,与原体系偏离了,没有能够利用起ITokenProviderFactory的功能。 要实现一个TokenProvider支持多个以key来区分的token,只需要参考DI的Key模式,为ITokenProvider增加
void ClearToken(sting Key);和Task<TokenResult> GetTokenAsync(string key);即可。
懂了懂了,感谢!
Signed-off-by: Vicente.Yu <^@^>
Signed-off-by: Vicente.Yu <^@^>
Signed-off-by: Vicente.Yu <^@^>
Signed-off-by: Vicente.Yu <^@^>
Signed-off-by: Vicente.Yu <^@^>
Signed-off-by: Vicente.Yu <^@^>
Signed-off-by: Vicente.Yu <^@^>
使用 MultiUserOAuthTokenAttribute 替代
Signed-off-by: Vicente.Yu <^@^>
WebApplication1 模拟客户端,有10个APP,轮流调用API。
WebApplication2 模拟服务端,提供 访问API 和 获取Token 接口。
使用AliasOAuthTokenAttribute来实现。
此实现不需要改动到ITokenProviderFactory和ITokenProvider两个核心接口,所有TokenProvider实现类依然能使用。
 
 
 
 fengb3
 
 
 
 commented
 Oct 12, 2024 
 
 
 
这个功能 还提供吗? 我现在 有需求就是同一个接口, 根据业务需求用不同的token去调用.
@fengb3 
当前支持到注册为多个别名,使用时通过别名参数指定。
 
 
 
 fengb3
 
 
 
 commented
 Oct 12, 2024 
 
 
 
当前支持到注册为多个别名,使用时通过别名参数指定。
有相关文档吗?
多个应用,共享一套api 的TokenProvider机制。