Skip to content

Instantly share code, notes, and snippets.

@nov
Created August 25, 2014 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nov/5852cf0ad912d9658320 to your computer and use it in GitHub Desktop.
Save nov/5852cf0ad912d9658320 to your computer and use it in GitHub Desktop.
class Identity::Google
def config
@config ||= OpenIDConnect::Discovery::Provider::Config.discover! Rails.application.secrets.google[:issuer]
end
def jwks
@jwks ||= config.jwks
end
def public_keys
jwks.inject({}) do |keys, jwk|
key = JSON::JWK.decode jwk
keys.merge! jwk[:kid] => key.public_key
end
end
:
:
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment