Forum Discussion
We are back up and running - we had been using the .NET Framework WebBrowser control, and the approach we took was replacing that component with WebView2, which is also a Microsoft component. Grabbed from NuGet and required relatively minimal code changes. You will have a new dependency on having the WebView2 runtime installed on client machines. It is not present on all machines by default.
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?
- SteveP14 months agoContributing User
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.
- 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.
- 4 months ago
Hi Phil,
It is, but from memory I had to change up the regex slightly from the original example code, so just check exactly what's coming back in the url and adjust accordingly.
Kind Regards,
Nathan
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.