Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Migration to go-oidc from upstream v1 #407

Merged
merged 1 commit into from
Aug 24, 2018
Merged

Migration to go-oidc from upstream v1 #407

merged 1 commit into from
Aug 24, 2018

Conversation

abstractj
Copy link

This change aims to make use of coreos/go-oidc. The generic adapter
aims to act as a sidecar, provide a way to SkipClientID is out of scope
for now.

That does not mean that we cannot revisit this in the near future.

This change aims to make use of coreos/go-oidc. The generic adapter
aims to act as a sidecar, provide a way to SkipClientID is out of scope
for now.

That does not mean that we cannot revisit this in the near future.
@jangaraj
Copy link
Contributor

Why github.com/coreos/go-oidc v1 and not v2? v1 seems to be a deprecated branch.

@@ -27,6 +27,18 @@
packages = ["."]
revision = "144418e1475d8bf7abbdc48583500f1a20c62ea7"

[[projects]]
branch = "v1"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we should probably use v2 if possible. Otherwise LGTM.

@abstractj
Copy link
Author

@jangaraj @slaskawi I understand your concern and it's a fair argument. Although, v1 and v2 are completely different APIs and there's a huge break of API compatibility. For example:

  • coreos/go-oidc/oauth2 turns into golang/x/oauth2
  • coreos/go-oidc/jose turns into square/go-jose
  • coreos/go-oidc/oidc turns into coreos/go-oidc

And they are completely different APIs, which requires a considerable amount of time migrating the codebase. Actually, we already have been working on it here: https://github.com/gambol99/keycloak-proxy/commits/develop.

This proposal to target v1 does not mean that things will be set in stone. But this change allows us to move forward and migrate this repository to Keycloak organization, and later revisit and continue the work to upgrade to v2.

@slaskawi
Copy link

@abstractj Ok, sounds perfectly reasonable. BTW, I already approved this PR.

@magnock
Copy link

magnock commented Aug 1, 2018

Hello,

Something changed since the merge, I've been using latest docker image with Azure AD Oauth2, it was working fine till 2 days ago.
Now I'm having this error : unable to verify the id token {"error": "oidc: JWT claims invalid: Invalid claim value: 'iss'. expected=https://login.microsoftonline.com/xxxxxxxxxxxxx/v2.0, found=https://sts.windows.net/xxxxxxxxxxxx/"}

It looks like the new merged oidc makes a request with no version, and receives a v1 Azure AD response (sts.windows.net/xxxxxxx) which is not expected.

I've tried to move to an old docker image, but I have the same problem. which I did'nt understand !!!

Thanks for your help.

@abstractj
Copy link
Author

@magnock I'm sorry but I'm not sure how this pull request relates with what you mentioned. Nothing was merged into master yet.

@gambol99
Copy link
Contributor

gambol99 commented Aug 2, 2018

hi @magnock ... perhaps something has changed upstream in Azure as I can't see anything that would have effected this between this and the last version here .. At the error is being thrown in the go-oidc lib which hasn't changed on master ... I recall their used to be an exception in go-oidc for google .. which used to do something similar, i.e. being issued a token outside of the issuer you called ...

i did see coreos/go-oidc#121 .. I've not read it fully ..

@abstractj abstractj requested a review from gambol99 August 8, 2018 13:34
@stianst stianst merged commit fa53727 into louketo:master Aug 24, 2018
@jangaraj
Copy link
Contributor

jangaraj commented Sep 3, 2018

@abstractj
Copy link
Author

@jangaraj thanks for reporting this. I will take a look at what's going on.

@lukasmrtvy
Copy link

lukasmrtvy commented Nov 1, 2018

@magnock Did you figure out, where is a problem?
I have same issue.

There is a problem with endpoint url:

https://login.microsoftonline.com/<tenant>/v2.0/.well-known/openid-configuration
returns issuer: https://login.microsoftonline.com/<tenant>/v2.0 

and

https://login.microsoftonline.com/<tenant>/.well-known/openid-configuration
returns issuer:  https://sts.windows.net/<tenant>/

Like you said, seems that endpoint/api version is ignored

@abstractj
Copy link
Author

@lukasmrtvy would you mind to file a Jira (https://issues.jboss.org/projects/KEYCLOAK) with a proper description, steps to reproduce and affected version? We moved from GH issues, and important things like this can be easily missed if commented on closed PRs.

Thanks in advance.

@marrobi
Copy link

marrobi commented Jun 23, 2020

Apologies for resurfacing an old issue, however I'm getting the same error as @magnock @lukasmrtvy above with Azure AD:

  error   unable to verify the id token   {"error": "oidc: JWT claims invalid: invalid claim value: 'iss'. expected=https://login.microsoftonline.com/xxxxx/v2.0, found=https://sts.windows.net/xxxxx/."}

Despite a v2 endpoint, a v1 token seems to be returned. Did anyone find a solution? All I can find is this closed issue: https://issues.redhat.com/browse/KEYCLOAK-8728 .

I can create a new issue if feel that would be useful. Thanks.

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

Successfully merging this pull request may close these issues.

8 participants