Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.