Forum Discussion
NathanCranethanks for sharing. I've found an ActiveX Control here that is basically WebView2 inside an ActiveX wrapper. I'm currently trialling it now in an MS Access form. The authentication appears to work, however I then get a message "desktop's server IP address could not be found". MikeG1 , can you confirm if "http://desktop" is still valid as the redirect URI?
Phil_Jeffrey_KCMaybe you're looking at the wrong property? When using WebBrowser the "http://desktop" was in the DocumentText property, after converting to WebView it's in Source.AbsoluteUri.
- The_Doc4 months agoUltimate Cover User
Hi Folks
I am going around in circles - I have just been told by Tana that everything is fixed yet I am still not being issued correct initial tokens.
My apps are built around MS Access - and the quickest was I found if the MYOB server is issuing tokens correctly is to post the initial
https://secure.myob.com/oauth2/account/authorize?client_id=xxxxxxxxxxxxxx&redirect_uri=http://desktop&response_type=code&scope=CompanyFile to a browser - chrome and I will see a code in the return address. Once I know that is working I can then go back into my own app and refresh and away it goes.
Since the 1st crash - I was off the air for 3 days until I found that this gave me 20 minute access - and told MYOB tues their refresh token was wrong.
After the MYOB fix tues - nothing worked.
I am dead - nothing gets me anything except offline tokens.
Has MYOB done something that this approach no longer works - if they are back online - what has changed.
My keys were revoked - and access permitted again - there is nothing my end that has changed.
Anyone go any ideas - surely I don't have to get access using their sdk only. I would have clients screaming for blood.
Regards The Doc
- Phil_Jeffrey_KC4 months agoExperienced User
Thanks SteveP1 . My problem seems to be, every time I navigate to the URL to get the authorization code, it redirects immediately to http://desktop without asking for my.myob login details. It asked for login details the first time, but since then I can't get the my.myob login screen to show. Is there some caching happening somewhere? Is there any way to force the login screen to appear?
- SteveP14 months agoContributing User
Phil_Jeffrey_KCWe do cache the token, it sounds like you might too. There's a description of using Windows Isolated Storage for caching MYOB tokens here: https://apisupport.myob.com/hc/en-us/articles/5215765325071-Cloud-Service
The location from the example is:
C:\Users\<username>\AppData\Local\IsolatedStorage\<randompath>\Tokens.json
There isn't anything in the file that identifies it as MYOB, so if it's there try renaming it and see if the login prompt comes back. If it still doesn't prompt for login, rename the file back because it might be for something else.
- Phil_Jeffrey_KC4 months agoExperienced User
Thanks SteveP1 , That put me on the right track. Although it seems the file is now called TokenCache.dat. I renamed the file, and the login screen has now re-appeared.
- SteveP14 months agoContributing User
Phil_Jeffrey_KC The reason I mentioned the Source property earlier is because I had the same symptom as you. I sent the initial request and when the response came back as the redirect URL ("http://desktop/...") I needed to parse it for the "code=<blah>", but I was looking in the wrong property so "code" wasn't found, so the logic assumed it was a "real" URL and tried to browse to "http://desktop?code=...". That seems to be what you're experiencing.
- Phil_Jeffrey_KC4 months agoExperienced User
SteveP1Thanks again. Because the old WebBrowser control contained the Auth Code in Document.Title, I was using the DocumentTitle property of the new AntView EdgeBrowser control, which I have now learned only contains the URL if the HTML document has no title. As you alluded to, it is the Source property that contains the full URL and hence the Auth Code. Thank you so much for putting me on the right track.
- The_Doc4 months agoUltimate Cover User
Hi Folks
I have just uploaded the WebViewer2 browser wrapper for Access - an ActiveX control - added it to my code that has worked for 5 years plus - and using the new ActiveX screen tried to get my Authentication Code with my initial GET call that is erroring on a chrome/edge browser.
My MYOB logon popped up - I authenticated, it asked me to ALLOW ACCESS - then an error page came up - don't know the payload but suspect same error as direct post to chrome or edge browser.
Haven't quite worked out AntView2 - its obj controls are very different from the original control - so I haven't captured the return from MYOB but
Here it is - seems like running up a VB.Net program likely produce the same error - MYOB's lic server is giving out the wrong Authorisation Codes to some people.
The Doc
- Phil_Jeffrey_KC4 months agoExperienced User
Hi The_Doc , the "code" should be in the "Source" property of the AntView control. It should return something like this:
http://desktop/?code=fiuohsdfgiuhyre8t7t83643hfigiues&^Ufu89hdfs7ty4jhr&scope= ....
So you will need to strip the first 21 characters at the start, and then everything from "&scope" onwards.
I've put my sample code in this thread if that helps.
- The_Doc3 months agoUltimate Cover User
Thanks for the information - I just didn't know the methods that came with Antview2 - very different from Access web browser - so was manually posting and on error page - Right clicking page but no "source" - so manually processed the above line = code as a legit Access Code and finally this morning the returned tokens were correct.
Now to sort out all my code - appreciate you code posted - will be very helpful - just don't need to lose time getting going - If I can just get my 7d Refresh I don't need anything more except to Refresh to work.
Hopefully all will work.
Regards The Doc
Looking for something else?
Search the Community Forum for answers or find your topic and get the conversation started!
Find technical support and help for all MYOB products in our online help centre
Dig into MYOB Academy for free courses, learning paths and live events to help build your business with MYOB.