-
Notifications
You must be signed in to change notification settings - Fork 95
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
Adopt provider metadata issuer from discovery document when doing token verification #86
Adopt provider metadata issuer from discovery document when doing token verification #86
Conversation
… instead of a fixed value.
@@ -288,7 +290,7 @@ extension LoginManager { | |||
func getJWK( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this method to something like getProviderMetadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed. got it~ thanks~
@@ -334,12 +336,12 @@ extension LoginManager { | |||
} | |||
} | |||
|
|||
func verifyIDToken(_ token: JWT, key: JWK, process: LoginProcess, userID: String?) throws { | |||
func verifyIDToken(_ token: JWT, expected: DiscoveryDocument.ResolvedProviderMetadata, process: LoginProcess, userID: String?) throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer some new line to make the code not extending too much. Can you set the "Page Guide" at column 120?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, thanks for the remind. My previous page guide
seems gone after switching between Xcode 10/11 😂
@@ -187,7 +187,9 @@ public class LoginManager { | |||
let group = DispatchGroup() | |||
|
|||
var profile: UserProfile? | |||
var webToken: JWK? | |||
|
|||
var expected: DiscoveryDocument.ResolvedProviderMetadata? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest providerMetadata
a better name. The issuer
is the expected value, but the JWK
is not what is expected, it is just a key to be used while verification.
f16acde
to
247258a
Compare
247258a
to
0d6389a
Compare
It's nice! |
About