How to set the access token myself in the AuthorizationData class?

Vitor Leal 1 Reputation point
2022-04-07T10:52:16.637+00:00

I have an AuthorizationData class:

val authData = new AuthorizationData()
  authData.setAccountId(accountId)
  authData.setCustomerId(customerId)
  authData.setDeveloperToken(developerToken)
  authData.setAuthentication(???) // what do I put here?

I need to set an Authentication class in authData.setAuthentication method. My only option is a OAuthWebAuthGrant:

val oauth = new OAuthWebAuthCodeGrant(clientId, clientSecret, redirectUri)

But the thing is, I don't want that. I just want to put my access token, I don't want the user to go get it; I'll be doing it manually.

Is there any way I can just put my beautiful access token inside this class?

Thanks.

Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
429 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.