Skip to content
Snippets Groups Projects
Commit 73e2250e authored by Murray, Troy's avatar Murray, Troy
Browse files

Remove old code, include commented placeholders for actual values that will be...

Remove old code, include commented placeholders for actual values that will be received, include camel case operation so module can be called as MSUnet
parent 7a8f66f2
No related branches found
No related tags found
No related merge requests found
module OmniAuth
module Strategies
class Msunet < OmniAuth::Strategies::OAuth2
option :name, :msunet
class MSUnet < OmniAuth::Strategies::OAuth2
option :client_options, {
#,:site => 'http://oauth.dev.ais.msu.edu'
site: "http://todo-after.dev/",
authorize_path: "/oauth/authorize",
authorize_url: "/oauth/authorize",
......@@ -11,13 +10,15 @@ module OmniAuth
}
uid do
# raw_info['uuid'].to_s
raw_info["id"]
end
info do
{
name: raw_info["name"],
email: raw_info["email"]
name: raw_info["name"].to_s,
# email: raw_info["emailaddress"].to_s
email: raw_info["email"].to_s
}
end
......@@ -28,64 +29,4 @@ module OmniAuth
end
end
# module OmniAuth
# module Strategies
# class Msunet < OmniAuth::Strategies::OAuth2
# option :name, 'msunet'
# option :client_options, {
# :site => 'http://oauth-server.dev',
# :authorize_path => '/oauth/authorize'
# # ,
# #:authorize_url => 'http://oauth-server.dev/oauth/authorize'
# #,:site => 'http://oauth.dev.ais.msu.edu'
# #,:token_url => 'https://oauth.dev.ais.msu.edu/oauth/access_token'
# }
# def request_phase
# super
# end
# def authorize_params
# super.tap do |params|
# %w[scope client_options].each do |v|
# if request.params[v]
# params[v.to_sym] = request.params[v]
# end
# end
# end
# end
# uid do
# raw_info['login'].to_s
# end
# info do
# {
# 'email' => email,
# 'name' => raw_info['name'],
# }
# end
# extra do
# {:raw_info => raw_info}
# end
# def raw_info
# access_token.options[:mode] = :query
# @raw_info ||= access_token.get('user').parsed
# end
# def email
# (raw_info['email'].nil? || raw_info['email'].empty?) ? primary_email : raw_info['email']
# end
# def primary_email
# primary = emails.find{|i| i['primary'] }
# primary && primary['email'] || emails.first && emails.first['email']
# end
# end
# end
# end
# OmniAuth.config.add_camelization 'msunet', 'Msunet'
OmniAuth.config.add_camelization 'msunet', 'MSUnet'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment