Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
openid_config_parser
Advanced tools
openid_config_parser
is a lightweight Rubygem containing a method that fetches and
parses OpenID Connect configuration data from a specified endpoint URL and returns a Hash
object. It includes error handling to manage various issues that might occur during the
HTTP request and JSON parsing process.
To install the gem run the following command in the terminal:
$ bundle add openid_config_parser
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install openid_config_parser
For non-Rails application you might need to require the gem in your file like so:
require 'openid_config_parser'
You can use the openid_config_parser
in any of your Rails controllers, models, or
other parts of your application.
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
def fetch_openid_config
endpoint = "https://example.com/.well-known/openid-configuration"
config = OpenidConfigParser.fetch_openid_configuration(endpoint)
if config
issuer = config.issuer # or config[:issuer]
auth_endpoint = config.authorization_endpoint # or config[:authorization_endpoint]
token_endpoint = config.token_endpoint # or config[:token_endpoint]
jwks_uri = config.jwks_uri # or config[:jwks_uri]
userinfo_endpoint = config.userinfo_endpoint # or config[:userinfo_endpoint]
# and so on
else
Rails.logger.error "Failed to fetch OpenID configuration"
end
rescue OpenidConfigParser::Error => e
Rails.logger.error "Error fetching OpenID configuration: #{e.message}"
end
end
Considering that HTTP request is made to fetch the endpoint configuration, you can call this method in a background job for optimized performance.
Bug reports and pull requests are welcome on GitHub at https://github.com/msuliq/openid_config_parser. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the OpenidConfigParser project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that openid_config_parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.