vault-php icon indicating copy to clipboard operation
vault-php copied to clipboard

Add more authentication strategies

Open CSharpRU opened this issue 8 years ago • 4 comments

The title says for itself :)

CSharpRU avatar Aug 18 '17 11:08 CSharpRU

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 🤷‍♀️, I'm not sure where to go from here without consulting you. (To be fair, I could have completely missed something.)

LavaToaster avatar Nov 02 '17 00:11 LavaToaster

@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.

CSharpRU avatar Nov 02 '17 06:11 CSharpRU

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

CSharpRU avatar Nov 02 '17 06:11 CSharpRU

This would bring - at least - LDAP, Okta, RADIUS Authentication Methods as well as Userpass. All of them can be mounted on non-default path segments.

https://github.com/CSharpRU/vault-php/pull/32

hexa2k9 avatar Mar 30 '20 11:03 hexa2k9