Jump to content

ZRomik

Members
  • Content Count

    54
  • Joined

  • Last visited

Everything posted by ZRomik

  1. ZRomik

    TSslHttpCli

    Is there a way to know that the TRestOAuth component has updated the authorization token if autoupdate is set?
  2. ZRomik

    TSslHttpCli

    I resolved this issue. In OnBgException event handler I set field CanClose to True. And the error message does't appear anymore
  3. ZRomik

    TSslHttpCli

    Thank you, François. Today I'm tested my app and found strange thing: handling OnRequestDone event of component TSslHttpCli raised EHttpException exception with message "OK". How I can delete this exception and resolve this issue?
  4. ZRomik

    TSslHttpCli

    Where to find svn repository address?
  5. ZRomik

    TSslHttpCli

    Today result of authorization Maybe need add message about bad authorization? Split "RedirectMsg" to "ResdirectSuccMsg" and "RedirectBadMsg" as case. And how can handle error while authorization process?
  6. ZRomik

    TSslHttpCli

    Angus, Can you do property TokenUrl for component TRestOAuth as published? Then component can be completely configured in design-time.
  7. ZRomik

    TSslHttpCli

    My token live 19 minutes. I must set property RefMinsPrior to 19?
  8. ZRomik

    TSslHttpCli

    Yes! It working! I mistaked and create event handler for wrong event. I am inattentive. Sorry and big thanks, Angus. And sorry for my english. Not my native language.
  9. ZRomik

    TSslHttpCli

    Good. Let's wait for the fix. But how it's work in demo app?
  10. ZRomik

    TSslHttpCli

    I'm understand. I speak about method inside component TSslHttpRest. That method does't executing when I manual execute procedure RestRequest(...). I'm process OnRestRequestDone event in my app but ResponseRaw property equal to empty string.
  11. ZRomik

    TSslHttpCli

    Hmmm I writed another small app only for rest auth. On form placed two components: TRestOAuth and TSslHttpRest. OAuth process is OK. I successfully got tokens. The OAuthRest process is bad. App still not executing procedure "onHttpRequestDone" inside component. Looks like I not set some parameters. Or Delphi do error while compiling app. Problem what inside component does't executing event handler OnRequestDone. And FResponseRaw field remains empty. When I comparing code in demo app and my own code I'm not seen big difference between them. I'm attach archive with my app. Can you look please and telling me where I'm do error? Debug.zip
  12. ZRomik

    TSslHttpCli

    Angus, this event raise one time inside component TSslHttpRest. I.e. procedure onHttpRequestDone calling only first time, when process authorization request. When I call procedure RestRequest this event does'nt raise. I can't understood why this strange thing happens.
  13. ZRomik

    TSslHttpCli

    Angus, I set a breakpoint on line 1448 in file OverbyteIcsSslHttpRest.pas. So, the event OnRestRequestDone raise only when app get access token. The raw response is: When I manual doing request then event not raising and FResponseRaw field not set value. In demo app these event raise both times. When I get tokens an when I doing manual rest request
  14. ZRomik

    TSslHttpCli

    autorefresh token not work if app in Idle, eg minimized to tray?
  15. ZRomik

    TSslHttpCli

    Change AsyncReq to false, but nothing changes: I'm handle OnRequestDone event: procedure TForm1.slhtprestRequestDone(Sender: TObject; RqType: THttpRequest; ErrCode: Word); var json: tjsonobject; begin if ErrCode <> 0 then mmo1.Lines.Add('Error while retrieving user data. Error #' + IntToStr(ErrCode)) else mmo1.Lines.Add('Request done. Request status #' + IntToStr(slhtprest.StatusCode)); if slhtprest.ResponseRaw <> '' then begin if Pos('{', slhtprest.ResponseRaw) > 0 then begin here be work with json object from response end; end; end;
  16. ZRomik

    TSslHttpCli

    While testing apps got different responses In demo app: In my own app: Responses has different size and different content. But ResponseRaw in my app is stll empty.
  17. ZRomik

    TSslHttpCli

    In this procedure I trying to retrieve user info: procedure TForm1.RetrieveUserInfo(const AToken: string); var url: string; code: Integer; begin slhtprest.AuthBearerToken := AToken; slhtprest.ServerAuth := httpAuthBearer; slhtprest.DebugLevel := DebugHdr; url := sAuthURL + sVerifyPath; slhtprest.SocketFamily := sfAny; slhtprest.RestRequest(httpGET, url, True, ''); end;
  18. ZRomik

    TSslHttpCli

    In demo app I seen: In my own app the "ResponseJson" property always equal empty string.
  19. ZRomik

    TSslHttpCli

    Headers from ICS: In demo-app I can retrieve user info from server, but can't do it from my own app. Headers from demo app:
  20. ZRomik

    TSslHttpCli

    Angus, how important these lines in demo app: HttpRest1.DebugLevel := THttpDebugLevel(DebugLogging.ItemIndex); HttpRest1.CertVerMethod := TCertVerMethod(CertVerMethod.ItemIndex); HttpRest1.SslCliSecurity := TSslCliSecurity(SslSecurity.ItemIndex); HttpRest1.SslReportChain := ReportCertChain.Checked; HttpRest1.SslRootFile := SslRootBundleFile.Text; HttpRest1.ServerAuth := THttpAuthType(AuthType.ItemIndex); HttpRest1.Username := AuthLogin.Text; HttpRest1.Password := AuthPassword.Text; HttpRest1.AuthBearerToken := AuthBearer.Text; HttpRest1.ExtraHeaders := ExtraHeaders.Lines; HttpRest1.SocketFamily := sfAny; { V8.57 IP4 and IPV6 } I trying get user info in my own app but got empty response from server.
  21. ZRomik

    TSslHttpCli

    I'm not understood what's happened... I'm changed auth url from "/oauth/v2/" to simply "/oauth/" and all working fine now. Maybe, this is errors on server side realisation of oauth2 protocol? Anyway, Angus and Allen, big thanks for useful help!
  22. ZRomik

    TSslHttpCli

    Where I can find log-file? And how I can wait response from server?
  23. ZRomik

    TSslHttpCli

    I'm trying to run the OverbyteIcsHttpRestTst demo app. When I press "Start REST Request" button I see in log that message: "HTTP Error 400. The request has an invalid header name."
  24. ZRomik

    TSslHttpCli

    As I telling yesterday the authorization process is OK. I'm using TRestOAuth component and got "access" and "refresh" tokens. Next I must post GET request as I described and get an response in JSON format similar to the following: In docs for EVE SSO describes how to Obtaining Character ID: When I trying to post GET request with described parameters the response from server is always empty. I.e. rcv.Size = 0. I trying set URL property of TSSlHttpCli component to "http://www.google.com" but response from server is empty. I think what I'm doing something wrong.
  25. I'm watching in "OverbyteIcsHttpRestTst" and trying to reproduce this in my app, but always got error "Failed to generate app token. App Authorization Code: blah-blah-blah". When I set parameters in demo app all ok. What I'm doing wrong? My code: const sAuthURL = 'https://login.eveonline.com/v2/oauth/authorize/'; sRedirectURI = 'http://localhost:5561/'; sSecretKey = '...'; sTokenURL = 'https://login.eveonline.com/oauth/token'; sClientID = '...'; sScopeList = 'esi-location.read_location.v1'; sLocalAddr = '127.0.0.1'; sLocalPort = '5561'; sTokenURL = 'https://login.eveonline.com/oauth/token'; procedure TForm1.imgLoginClick(Sender: TObject); begin mem1.Lines.Clear; SetupOAuth; if rest.StartAuthorization then begin mem1.Lines.Add('Waiting for authorization token...'); end else begin mem1.Lines.Add('Error while get authorization token: ' + rest.LastError); end; end; procedure TForm1.SetupOAuth; begin rest.DebugLevel := DebugSsl; rest.ProtoType := OAuthv2; rest.AuthType := OAuthTypeWeb; rest.AppUrl := sAuthURL; rest.ClientId := Trim(sClientID); rest.RedirectUrl := Trim(sRedirectURI); rest.ClientSecret := Trim(sSecretKey); rest.RedirectUrl := Trim(sRedirectURI); rest.Scope := sScopeList; rest.OAOptions := []; rest.RefreshAuto := True; rest.WebSrvIP := sLocalAddr; rest.WebSrvPort := sLocalPort; rest.TokenUrl := sTokenURL; end; When I run my app and step by break-points I see what event "OnRestRequestDone" never rise. Is it ok?
×