[英]OAuth Bearer token implementation using C#
我是OAuth的新手。 我的要求是托管一個基於Rest的服務URL,只能通過提供一個承載令牌來訪問它。 另外,我不希望用戶瀏覽任何“登錄”頁面,只需傳遞Bearer令牌並開始使用資源Url。
if (bearertoken != null) {
if(bearertoken == "abc") {
//do the operation and return http status code 200
}
else {
//return failure
}
}
請幫助!!!
謝謝,M
鑒於那里有很多開源和商業OIDC / OAuth軟件包,因此您不應該真正嘗試推出自己的解決方案。 我一直在使用Identity Server 3( https://github.com/IdentityServer/IdentityServer3 ),它是開源的,相對容易設置,在活躍的社區中得到很好的支持,並且附帶大量示例,您可以使用加快OIDC / OAuth的速度。 如果您在.NET Core世界中,則可以使用Identity Server 4( https://github.com/IdentityServer/IdentityServer4 )。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.