OmniAuth::Crest
This gem provides the EVE Online/CREST strategy for OmniAuth.
This allows your users to authenticate themselves via their EVE Online Character.
auth_hash example:
{
"provider" => "crest",
"uid" => 1337,
"info" => {
"name" => "Foo Bar",
"character_id" => 1337,
"expires_on" => "2015-08-05T07:02:55",
"scopes" => "",
"token_type" => "Character",
"character_owner_hash" => "b4d455="
},
"credentials" => {
"token" => "...",
"expires_at" => 1438758175,
"expires" => true
},
"extra" => {
"raw_info" => {
"CharacterID" => 1337,
"CharacterName" => "Foo Bar",
"ExpiresOn" => "2015-08-05T07:02:55",
"Scopes" => "",
"TokenType" => "Character",
"CharacterOwnerHash" => "b4d455="
}
}
}
Usage
Include the gem in your Gemfile:
gem 'omniauth-crest'
Once the gem is installed, you need to add the middleware.
# Rails:
# config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider :crest, 'client_id', 'secret_key'
end
# OR
# Rack
use OmniAuth::Builder do
provider :crest, 'client_id', 'secret_key'
end
Put in your Client ID and Secret Key of course. You can get them from https://developers.eveonline.com/applications
For more information on OmniAuth see the OmniAuth Wiki.
Scopes & Authenticated CREST
If you wish to define app-wide scopes for authenticated CREST, add a scope parameter to the middleware:
# Rails:
# config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider :crest, 'client_id', 'secret_key',
scope: 'publicData characterLocationRead'
end
# OR
# Rack
use OmniAuth::Builder do
provider :crest, 'client_id', 'secret_key',
scope: 'publicData characterLocationRead'
end
Possible Scopes
As of 2016-05-12
:
- characterAccountRead: Read your account subscription status.
- characterAssetsRead: Read your asset list.
- characterBookmarksRead: List your bookmarks and their coordinates.
- characterCalendarRead: Read your calendar events and attendees.
- characterChatChannelsRead: List chat channels you own or operate.
- characterClonesRead: List your jump clones, implants, attributes, and jump fatigue timer.
- characterContactsRead: Allows access to reading your characters contacts.
- characterContactsWrite: Allows applications to add, modify, and delete contacts for your character.
- characterContractsRead: Read your contracts.
- characterFactionalWarfareRead: Read your factional warfare statistics.
- characterFittingsRead: Allows an application to view all of your character's saved fits.
- characterFittingsWrite: Allows an application to create and delete the saved fits for your character.
- characterIndustryJobsRead: List your industry jobs.
- characterKillsRead: Read your kill mails.
- characterLocationRead: Allows an application to read your characters real time location in EVE.
- characterLoyaltyPointsRead: List loyalty points your character has for the different corporations.
- characterMailRead: Read your EVE Mail.
- characterMarketOrdersRead: Read your market orders.
- characterMedalsRead: List your public and private medals.
- characterNavigationWrite: Allows an application to set your ships autopilot destination.
- characterNotificationsRead: Receive in-game notifications.
- characterOpportunitiesRead: List the opportunities your character has completed.
- characterResearchRead: List your research agents working for you and research progress.
- characterSkillsRead: Read your skills and skill queue.
- characterStatsRead: Yearly aggregated stats about your character.
- characterWalletRead: Read your wallet status, transaction, and journal history.
- corporationAssetRead: Read your corporation's asset list.
- corporationBookmarksRead: List your corporation's bookmarks and their coordinates.
- corporationContractsRead: List your corporation's contracts.
- corporationFactionalWarfareRead: Read your corporation's factional warfare statistics.
- corporationIndustryJobsRead: List your corporation's industry jobs.
- corporationKillsRead: Read your corporation's kill mails.
- corporationMarketOrdersRead: List your corporation's market orders.
- corporationMedalsRead: List your corporation's issued medals.
- corporationMembersRead: List your corporation's members, their titles, and roles.
- corporationShareholdersRead: List your corporation's shareholders and their shares.
- corporationStructuresRead: List your corporation's structures, outposts, and starbases.
- corporationWalletRead: Read your corporation's wallet status, transaction, and journal history.
- fleetRead: Allows real time reading of your fleet information (members, ship types, etc.) if you're the boss of the fleet.
- fleetWrite: Allows the ability to invite, kick, and update fleet information if you're the boss of the fleet.
- publicData: Allows access to public data.
- structureVulnUpdate: Allows updating your structures' vulnerability timers.
Per-Request Options
If you want to define the scope on a per-request basis, you can pass it to the
OmniAuth request phase URL, for example:
/auth/crest?scope=publicData+characterLocationRead
Questions
Ask me on Twitter at @dratir.
Contribute
If you find a Bug or have a feature suggestion, please open an Issue on GitHub.
COPYRIGHT NOTICE
EVE Online and the EVE logo are the registered trademarks of CCP hf. All rights are reserved worldwide. All other trademarks are the property of their respective owners. EVE Online, the EVE logo, EVE and all associated logos and designs are the intellectual property of CCP hf. All artwork, screenshots, characters, vehicles, storylines, world facts or other recognizable features of the intellectual property relating to these trademarks are likewise the intellectual property of CCP hf. CCP hf. has granted permission to Manuel Hutter to use EVE Online and all associated logos and designs for promotional and information purposes on its website but does not endorse, and is not in any way affiliated with, Manuel Hutter. CCP is in no way responsible for the content on or functioning of this website, nor can it be liable for any damage arising from the use of this website.