Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to set 'x5t' in header #53

Closed
fipp opened this issue Nov 11, 2015 · 3 comments
Closed

need to set 'x5t' in header #53

fipp opened this issue Nov 11, 2015 · 3 comments
Assignees
Milestone

Comments

@fipp
Copy link

fipp commented Nov 11, 2015

Hi! I am creating a PHP application that will read/write to my organizations office 365 calendar's. In order to get a valid authentication token to use in the Calendar API, I need to do send a POST request to the token issuing authority, containing a JSON Web Token signed with a private x509 key. A certificate thumbprint of the public key needs to be set as the value of the x5t key in the JWT header, if not I'm getting the following error:

Invalid JWT token. No certificate thumbprint specified in token header.

Can I modify the headers with this library? I've checked, and I cannot find a way. If not, do you plan to support it?

@lcobucci
Copy link
Owner

Hey @fipp!

I was planning to add that kind of header in the next major release (along with JWK support #32) but I think that it's quite simple to implement that in v3.x.

The simplest solution that comes to me now is adding a method in Builder to configure token headers (something like setHeader(string $name, mixed $value):Builder and just changes the headers only if it's not signed).

Using JWK would be much easier since things would be validated on the key creation, but thats what we're able to do now.

Would you like to send a PR with something close to that (using the branch 3.1)?

@lcobucci lcobucci modified the milestone: 3.1.0 Nov 14, 2015
@lcobucci lcobucci self-assigned this Nov 15, 2015
@lcobucci
Copy link
Owner

Hey @fipp go and install v3.1.0 and you'll able to change the token using the setHeader() method on Builder.

@fipp
Copy link
Author

fipp commented Nov 18, 2015

Thank you very much, great work! Sorry that I couldn't get around to submitting a PR...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants