[英]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.