How to retrieve an Authentication tokens in a get request?

  • Автор темы Автор темы xirosxvi
  • Дата начала Дата начала

xirosxvi

Client
Регистрация
24.09.2019
Сообщения
20
Реакции
0
Баллы
1
Hello,

I can't get Authorization Bearer.
When I connect to a platform, this platform automatically generates a token for the session.

I would like to get this token to make get requests on the site.

Do you have a solution? It would help me a lot

Best regards
 

Вложения

  • autho.JPG
    autho.JPG
    49,8 KB · Просмотры: 209
How do you get token manually from this service in browser?
 
I would like to get it and put it in a variable
 
Hello,

I can't get Authorization Bearer.
When I connect to a platform, this platform automatically generates a token for the session.

I would like to get this token to make get requests on the site.

Do you have a solution? It would help me a lot

Best regards

You can get headers like this.

C#:
Развернуть Свернуть Копировать
instance.SetUserHeader("Test", "Login_data"); // demo header
instance.UseTrafficMonitoring = true;
string url = "https://nghttp2.org/httpbin/get";
instance.ActiveTab.Navigate(url);
instance.ActiveTab.WaitDownloading();

var items = instance.ActiveTab.GetTraffic();
if(items.Count() > 0) {
    foreach(var item in items){
        if(item != null) {
            if(item.Url.Contains(url)){
                project.SendInfoToLog(Global.ZennoLab.Json.JsonConvert.SerializeObject(item,  Global.ZennoLab.Json.Formatting.None));
               
                return item.RequestHeaders;
            }
        }
    }
}
99380



The same code without notice in the log and unnecessary checks that were used to verify the correctness of the work.
C#:
Развернуть Свернуть Копировать
instance.UseTrafficMonitoring = true;
string url = "https://nghttp2.org/httpbin/get";
instance.ActiveTab.Navigate(url);
instance.ActiveTab.WaitDownloading();

var items = instance.ActiveTab.GetTraffic();
foreach(var item in items){
 if(item.Url.Contains(url))    return item.RequestHeaders;
}
 
Последнее редактирование:

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)