oAuth2 worker object weirdness

Doug Easterbrook doug at artsman.com
Wed Aug 7 00:19:05 UTC 2024


Hi joe.

Just to check some assumptions. … I assume oAuthWorker

is defined in your library classes as an ‘object
it inherits from $extobjects.OW3.$objects.OAUTH2Worker, so that the $superclass looks like '.OW3.OW3 Worker Objects\OAUTH2Worker’

and when in instantiate it using

Do $objects.oAuthWorker.$newref() Returns iorOAUTH2

I would put in a temporary method in your oAuthWorker object such as $initialize



and then try getting to if by referring to 

do iorOAUTH2.$initialize



If you can step into that method and then see all the properties and methods, it should work




We do that for HTTP, FTP, iMap, SMTP, Pop3 and crypto workers 



Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On Aug 6, 2024, at 4:05 PM, Joe Maus <jmaus at theccgllc.com> wrote:
> 
> Hi,
> 
> Omnis 10.22 31896
> 
> So, I created an oAuthWorker object subclassed from the oAUTH2Worker so I could add some token handling code to deal with the change in the Access token (overriding $tokensrefreshed to save the new data) and it won't work with my oHttpWorker object that is subclassed from the OW3 HTTP worker.  
> 
> If I do this:
> 
> Do $extobjects.OW3.$objects.OAUTH2Worker.$newref() Returns iorOAUTH2
> 
> Then most everything works - I can assign the object reference to the http.$oauth2 method and the https object will happily send my email.  But I can't save the new oauth details when the tokens are refreshed. If I use the subclassed object, by running this:
> 
> Do $objects.oAuthWorker.$newref() Returns iorOAUTH2
> 
> I get everything in it like is seen in the reference created from the base OW3 object, that is, the token is there along with all of the other bits of data and properties and it even allows the code to call my $completed method in the HTTP object ref derived from the subclassed OW3 HTTP object, but the assignment to http.oauth2 fails.  I just get a flag false back from the assignment:
> 
> Do iorHttp.$oauth2.$assign(iorOAUTH2) Returns lOk
> 
> Anyone have any idea why this assignment would fail or how I might get more information on why the assignment failed?  The $completed method does confirm it is not set with this error: "Request is missing required authentication credential."
> 
> Kind regards,
> 
> Joe Maus
> jmaus at theccgllc.com
> 303-349-6696
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com



More information about the omnisdev-en mailing list