Add more authentication strategies
CSharpRU opened this issue · 4 comments
The title says for itself :)
I'm trying to work out how to add in a normal token strategy, but I'm having a little trouble with it right now. (See this for why I need a token strategy)
From what I can work out, the auth strategies require a request to be made, and then an "auth" in the response.
I initially thought I could just make a request to the Token Lookup (Self) endpoint, however, you don't get this "auth" endpoint. I then thought about renewing the token, however, for root tokens or non-renewable tokens the endpoint just returns a failure.
So
@Lavoaster You don't need to do any request within your Token strategy, just return Auth object with token assigned to it. After you call authenticate on client with you Token strategy it will automatically call lookup self to get info about token.
But also I suppose that you want to check you really have info about your token after this line (because you'll not do any request to Vault and there will be no response for check): https://github.com/CSharpRU/vault-php/blob/master/src/Client.php#L221