Bring back username/password to make it work under CDN #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is mainly to enable username/password credential now that we use CDN and need a token to access it.
The idea is that when using username/password, the AccessKey request would fail as we still use such u/p credentials where in fact we should use stored reusable credentials (the one obtained after authentication using u/p). This PR does not overwrite the authData in blob or ctx->config but instead return reusable credendials obtained after Session::authenticate and let the application replace ctx->authData (which main be the password in case username/password was used) by these. Now an AccessKey can be obtained.
I've also modified the example so that the credentials can be stored in a json file that can be used later, instead or requiring user/password again. It's less dangerous than forcing people to use password all the time, they just have to secure the json file.
That also answers the issue #153
NB: also fix a tiny typo in header files and the .gitmodules wrongly points to my Bell repository fork, should be ignored