Thank you for visiting our Partner Zone. This area is an exclusive space for MYOB Partners. Find out how to Partner with MYOB.
September - last edited September
September - last edited September
I am getting the access code just fine and authenticating using POSTMAN and it is returning the authentication token. I have also build my own oauth class to make the calls to get the access code and then auth token. These methods both work.
However when I look at this article https://apisupport.myob.com/hc/en-us/articles/5215765325071-Cloud-Service
it shows to insert the access code in this line
var tokens = oauthService.GetTokens(OAuthLogin.GetAuthorizationCode(configuration));
but that gives me a 400 bad request.
Like I said in my own code I retrieve the token just fine and end up doing this instead assigning the token I get to the keystore.OAuthResponse and thisends up working fine
var keystore = new SimpleOAuthKeyService(); keystore.OAuthResponse = new OAuthTokens { AccessToken = myobTokens.AccessToken, ExpiresIn = int.Parse(myobTokens.ExpiresIn), ReceivedTime = myobTokens.TokenTime, RefreshToken = myobTokens.RefreshToken, Scope = myobTokens.Scope, TokenType = myobTokens.TokenType };
but it leads me to belive that the SDK is not working for authentication...have I got this wrong? is anyone using the SDK Authentication successfully by passing the access code in? or is noone using the SDK? have you just built your own clients for accessing the API?
Have I got the code wrong?
I am assuming that the parameter "code" (see screenshot) is referring to the access code. Can someone confirm this please
September
September
As per the following line in the article:
The function OAuthLogin.GetAuthorizationCode is a helper class created in the samples that illustrates how to create a form that launches the secure.myob.com my.MYOB login page.
However, it appears that the samples no longer exist (or I can't find them).
September
September
Ah..I see..yes I tried lookinf for it as well and I cannot see it either
When I went thru the doco there were a lot of 404 so this does not surprise me. Not bagging MYOB but simply pointing out a fact
I ended up writing my own class to extract the auth code and then attempted to insert it and like my post says it does not work. I am "talking" to someone in support at the moment (support is very slow) and they are looking into it
I know I have got the right auth code as I can use it toretreive the tokens and then assign the token to the SDK and make a valid call