
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
OmniAuth strategy for authenticating via NFT ownership
Add this line to your application's Gemfile:
gem 'omniauth-nft'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install omniauth-nft
Add as a strategy to your omniauth config. Eg:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :nft,
checker_type: :opensea,
checker_options: { testnet: true },
nft_collection: { slug: 'untitled-collection-4919696' }
provider :developer unless Rails.env.production?
end
This configuration will run against OpenSea testnet and allow login for anyone that owns an NFT in the Test Prota Collection
UID is set to a combination of nft_collection slug and the nft token_id.
Authenticated users will have an auth.info hash with the name and image url of the NFT.
auth.extra
contains a wallet
key (the authenticated wallet address) and a raw_info
hash which contains all NFT metadata retrieved by NftChecker
.
You can implement User#find_or_create_from_auth_hash
like this:
def User.find_or_create_from_auth_hash(auth)
identity = { provider: auth['provider'], uid: auth['uid'] }
User.find_or_create_by!(identity) do |record|
case auth[:provider]
when 'nft'
record.name = auth.info['name']
record.profile_url = auth.info['image']
else
raise 'Unexpected provider!'
end
end
end
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/valthon/omniauth-nft.
FAQs
Unknown package
We found that omniauth-nft demonstrated a not healthy version release cadence and project activity because the last version was released 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.