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

SA jwt can not unmarshal .exp field #187

Closed
aldiserg opened this issue Dec 29, 2022 · 2 comments
Closed

SA jwt can not unmarshal .exp field #187

aldiserg opened this issue Dec 29, 2022 · 2 comments

Comments

@aldiserg
Copy link

Trying to use SA jwt via cli version 0.21.0-beta

pomerium-cli k8s exec-credential --service-account-file jwt https://api.test.ru

Getting:

ERR exit error="json: cannot unmarshal number 1.672319325e+09 into Go struct field .exp of type int64"

decrypted jwt (second part)

{
  "aud": "httpbin.test.ru",
  "email": "valid email",
  "exp": 1672319325,
  "groups": [],
...
@desimone desimone added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 30, 2022
@calebdoxsey calebdoxsey self-assigned this Jan 3, 2023
@calebdoxsey
Copy link
Contributor

I made a simple test and I cannot reproduce the issue. json is able to unmarshal that time.

	rnd := rand.New(rand.NewSource(1))

	key, err := ecdsa.GenerateKey(elliptic.P256(), rnd)
	require.NoError(t, err)

	signer, err := jose.NewSigner(jose.SigningKey{Algorithm: jose.ES256, Key: key}, nil)
	require.NoError(t, err)

	jws, err := signer.Sign([]byte(`{"exp": 1672319325}`))
	require.NoError(t, err)

	sig, err := jws.CompactSerialize()
	require.NoError(t, err)

	cred, err := parseToken(sig)
	if assert.NoError(t, err) {
		assert.NotNil(t, cred)
	}

I'm not sure where the error is occurring.

@calebdoxsey calebdoxsey removed their assignment Jan 3, 2023
@calebdoxsey calebdoxsey added the blocked PR/ISSUE is blocked by third party label Jan 3, 2023
@desimone desimone added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 4, 2023
@kenjenkins
Copy link
Contributor

This should be fixed in Pomerium v0.22.3 or later (see pomerium/pomerium#4149).

@kenjenkins kenjenkins removed blocked PR/ISSUE is blocked by third party NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants