简体   繁体   English

如何使用keycloak auth从web资源获取生成的访问令牌

[英]How to get generated access token from web resource with keycloak auth

I am developing an application on WPF in order to quickly work with a web application via api ( clarification: login and password are required for authorization ).我正在 WPF 上开发一个应用程序,以便通过 api 快速使用 web 应用程序(说明:授权需要登录名和密码)。 The essence of the api work is to substitute the generated token to the method, which is updated every 4 hours. api工作的实质是将生成的token代入方法,每4小时更新一次。

I can manually log into the site every 4 hours and collect this token from devtools, but I would like to automate this process and write a small console application that would automatically collect this token.我可以每 4 小时手动登录一次该站点并从 devtools 收集此令牌,但我想自动化此过程并编写一个小型控制台应用程序来自动收集此令牌。 I tried to find a suitable solution for me, but unfortunately I did not succeed.我试图找到适合我的解决方案,但不幸的是我没有成功。 Is there a way to do this?有没有办法做到这一点?

PS The authorization page has its own yurl. PS 授权页面有自己的网址。 After successful authorization, redirection to the service occurs.成功授权后,将重定向到服务。

Open your browser DevTools and capture the request which leads to the Token.打开浏览器 DevTools 并捕获导致令牌的请求。 Then write a code in your console application to call that request with HTTPClient or whatever library you want and you have the token to work with.然后在您的控制台应用程序中编写代码以使用 HTTPClient 或您想要的任何库调用该请求,并且您拥有可以使用的令牌。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取身份验证令牌以创建资源组 - How to get an auth token to make a resource group 从已经为Microsoft Graph资源生成的访问令牌中获取SharePoint Access令牌(https://graph.microsoft.com) - Get SharePoint Access token from already generated access token for the Microsoft Graph resource (https://graph.microsoft.com) 如何使用Xamarin.Auth获取访问令牌? - How to get access token with Xamarin.Auth? 如何在Web Api OAuth中获取访问令牌? - How to get access token in Web Api OAuth? 活动身份验证方案。 如何使用合作伙伴/用户ADFS的令牌在家庭/资源ADFS上发行令牌 - Active auth scenario. How to issue token on home/resource ADFS using token from partner/users ADFS 如何使用访问令牌请求 microsoft azure 资源? 简而言之,我们如何在 azure 中使用生成的 access_token? - How to request a microsoft azure resource using a access token? In short how can we use the generated access_token in azure? 如何将授权令牌传递给GET方法以访问授权资源? - How to pass authorization token to GET method to access authorized resource? 如何从网页获取链接资源? - How to get linked resource from a web page? ASP.NET Web API 和 OpenID Connect:如何从授权码获取访问令牌 - ASP.NET Web API and OpenID Connect: how to get Access Token from Authorization Code 如何从第三方访问令牌asp.net Web api2获取用户电子邮件? - How to get User Email from third party access token asp.net web api2?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM