Adobe-Marketing-Cloud / analytics-java-library

A Java client library for Analytics APIs
Apache License 2.0
15 stars 16 forks source link

WebServer Grant #18

Open laiyhman opened 7 years ago

laiyhman commented 7 years ago

Hi,

Can I suggest to add one more authentication method for Webserver Grant?

Currently the API provides: authenticateWithSecret(String username, String secret) authenticateWithJWTOAuth(Path privateKeyPath, String clientId, String username) authenticateWithJWTOAuth(byte[] privateKey, String clientId, String username) authenticateWithClientCredentialsOAuth(String clientId, String secret)

May be something like ? authenticateWithWebServerGrantOAuth(String authorizationCode)

trekawek commented 6 years ago

Hello @laiyhman. Thanks for comment. Maybe you can post a draft implementation of such authentication method?

laiyhman commented 6 years ago

Hi,

I think i meant to type refreshToken instead of authorizationCode, perhaps something like authenticate(String accessToken, String refreshToken), auto refresh if expired. Imagine there's a front end where user go through the consent etc, and store the access token and refresh token, which the backend can later use to run the job.