Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

OAuth2 Revisited

 Post Reply Post Reply
Author
Randall Ken View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Oct 2014
Posts: 646
Post Options Post Options   Quote Randall Ken Quote  Post ReplyReply Direct Link To This Post Topic: OAuth2 Revisited
    Posted: 18 May 2019 at 12:45pm
I can't actually believe that I managed to get this to work! Thanks again :)
Back to Top
Randall Ken View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Oct 2014
Posts: 646
Post Options Post Options   Quote Randall Ken Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2019 at 4:42pm
Thanks Bruno.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 7968
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2019 at 2:43pm
You can make call a function from a window opener, so you'd need to find if you can call the opener from this GET handler:
See also:

We used a similar technique for enabling OAUTH2 (see Google Calendar sample) in a TMS WEB Core application where the OAUTH authentication window calls a function in the opener window to communicate the access token.
Back to Top
Randall Ken View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Oct 2014
Posts: 646
Post Options Post Options   Quote Randall Ken Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2019 at 1:20pm
Hi,

I cannot use a TWebRestClient to get a token from the HMRC site because of CORS so I have to find another way of doing this. The following opens the page correctly:

URL:=HMRCAuthorizationEndpoint+'?response_type=code&client_id='+SA_Client_ID+
    '&scope=hello%20read:vat%20write:vat&redirect_uri=http://localhost:8000/Bridge/Bridge.html';
asm
   window.open(URL, 'oauth', 'width=800, height=600, location=no, toolbar=no, menubar=no,
     titlebar=no. location=no');
end;

When the user has authorised our usage HMRC will do GET http://localhost:8000/Bridge/Bridge.html?code=hujuhkjhksdhkhs

How can I get this code?

Thanks,

Ken
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down