Sha256: 610f0ba5c14727bf8bca1b892b42868185a71e747f5715baef55e91b590d74c7
Contents?: true
Size: 646 Bytes
Versions: 15
Compression:
Stored size: 646 Bytes
Contents
require 'omniauth' require 'omniauth-oauth2' module OmniAuth module Strategies class Openstax < OAuth2 option :name, "openstax" option :client_options, { site: "http://accounts.openstax.org", authorize_url: "/oauth/authorize" } uid { raw_info[:uuid] } info do # Changed to conform to the omniauth schema raw_info.slice(:name, :first_name, :last_name, :title).merge(nickname: raw_info[:username]) end extra { { raw_info: raw_info } } def raw_info @raw_info ||= access_token.get('/api/user.json').parsed.symbolize_keys end end end end
Version data entries
15 entries across 15 versions & 1 rubygems