apple/app-store-server-library-java

Add method parameters in AppStoreServerAPIClient methods to accept bearer token

sagar-rai opened this issue · 2 comments

As a developer i think that while following a good design pattern, most of the services should create a single instance of the client for the production environment, providing a method to pass a bearer token, takes away the need to maintaining and refreshing the client every 5 minutes(expiry of the jwt bearer token). This still maintains security since the dev does not hardcode any secrets in config/code and still provides the flexibility to not create a client on the fly or maintain the overhead of refresh.

@alexanderjordanbaker what do you think, is it fine to open a pr for the same.

nvm, i checked the code, token is generated for each request

Yep! This client should ideally be a singleton, it will handle token re-creation