NetTalk Central

Author Topic: Sending URL directly from within code  (Read 1755 times)

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Sending URL directly from within code
« on: August 17, 2014, 03:18:24 PM »
I would like to send a URL from within my coding, in the same way as if you created a button with a URL on it and then the user clicked on the button. This is needed for an OAuth process. The closest template code I can find to do this is in a NetWebPage. So I'm thinking maybe something like the following:

LOC:MyURL = 'https://www.somecompany.com/somefolder/someaction'
LOC:Length = Len(Clip(LOC:MyURL))
p_web.ParseHTML(LOC:MyURL,1,LOC:Length,Net:NoHeader)

Regards,

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Sending URL directly from within code
« Reply #1 on: August 17, 2014, 10:36:52 PM »
Hi Mark,

You might be asking 1 of 2 things, but I think what you're asking is how to make your _server_ act as a _client_ to another server? ie you are completely automating the oauth process in your server, so your actual user never sees it?

In this situation you need to think "web client" not "web server". It's easy to add a web client to the server -

see Webinar #8
http://www.capesoft.com/accessories/NetTalkUserGroup.htm
at around 0:32

Cheers
Bruce

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Sending URL directly from within code
« Reply #2 on: August 18, 2014, 04:29:42 PM »
As soon as the Capesoft web site is back up, I will go look at it.

In the meantime, during the OAuth processing, I submit a URL to the provider with various requested parameters, including a redirect URL. Their response is redirected back to the specified redirect url where I have to be able to read the incoming header to take further action.I have specified the redirect URL as: https://[mydomain].com/oauthredirect/[myuserguid]...

In my WebHandler, I added an instring search for "oauthredirect" near the top of the p_web._SendFile procedure where the internal procedures are parsed. Apparently that's not the correct embed point as I am receiving the browser's "web page not found" error. Which embed point in the WebHandler would be correct?

Thanks,

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Sending URL directly from within code
« Reply #3 on: August 18, 2014, 11:15:14 PM »
That's the right place - I'm guessing you need to check your code there for a bug.

Cheers
Bruce