diff --git a/builtin/credential/cert/path_login.go b/builtin/credential/cert/path_login.go index 6ad76c6f86..ce336fe629 100644 --- a/builtin/credential/cert/path_login.go +++ b/builtin/credential/cert/path_login.go @@ -9,6 +9,7 @@ import ( "errors" "strings" + "github.com/hashicorp/vault/helper/certutil" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/logical/framework" ) @@ -67,8 +68,10 @@ func (b *backend) pathLogin( Policies: matched.Entry.Policies, DisplayName: matched.Entry.DisplayName, Metadata: map[string]string{ - "cert_name": matched.Entry.Name, - "common_name": clientCerts[0].Subject.CommonName, + "cert_name": matched.Entry.Name, + "common_name": clientCerts[0].Subject.CommonName, + "subject_key_id": certutil.GetOctalFormatted(clientCerts[0].SubjectKeyId, ":"), + "authority_key_id": certutil.GetOctalFormatted(clientCerts[0].AuthorityKeyId, ":"), }, LeaseOptions: logical.LeaseOptions{ Renewable: true,