-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2f3857
commit 4e26290
Showing
7 changed files
with
101 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
%div{:"data-role" => "header", :"data-theme" => "e"} | ||
%h1 Error Occurred! | ||
%div{:class => "ui-body ui-body-e"} | ||
%p #{message} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,53 @@ | ||
!!! 5 | ||
%html{ :lang => "en"} | ||
%head | ||
%title= "omniauth-salesforce-example" | ||
%meta{ :name => "viewport", :content => "width=device-width, initial-scale=1"} | ||
%link{ :href => url("/jquery.mobile-1.1.0.css"), :media => "screen", :rel => "stylesheet", :type => "text/css" } | ||
%script{ :src => url("/jquery-1.7.2.min.js")} | ||
%script{ :src => url("/jquery.mobile-1.1.0.js")} | ||
%body | ||
%div{ :id => "foo", :"data-role" => "page", :"data-title" => "omniauth-salesforce-example"} | ||
%div{ :"data-role" => "header"} | ||
%h1 omniauth-salesforce-example | ||
%div{ :"data-role" => "content"} | ||
- if session[:auth_hash] == nil | ||
%h3 You are NOT authenticated. | ||
%a{:"data-role" => "button", :"data-ajax" => "false", :href => "#", :onclick => "document.authenticate_form.submit();"} Authenticate using your salesforce credentials | ||
%form{:id => "authenticate_form", :name => "authenticate_form", :action => "/authenticate", :method => "post"} | ||
%div{:class => "ui-body"} | ||
%div{:"data-role" => "collapsible", :"data-collapsed" => "true", :"data-theme" => "b", :"data-content-theme" => "c"} | ||
%h3 Authentication Options | ||
%p | ||
%div{:"data-role" => "fieldcontain"} | ||
%fieldset{:"data-role" => "controlgroup"} | ||
%legend Environment | ||
%input{:type => "radio", :name => "options[provider]", :id => "options[provider]-1", :value => "salesforce", :checked => true} | ||
%label{:for => "options[provider]-1"} production (login.salesforce.com) | ||
%input{:type => "radio", :name => "options[provider]", :id => "options[provider]-2", :value => "salesforcesandbox"} | ||
%label{:for => "options[provider]-2"} sandbox (test.salesforce.com) | ||
%input{:type => "radio", :name => "options[provider]", :id => "options[provider]-3", :value => "salesforceprerelease"} | ||
%label{:for => "options[provider]-3"} pre-release (prerellogin.pre.salesforce.com) | ||
%input{:type => "radio", :name => "options[provider]", :id => "options[provider]-4", :value => "databasedotcom"} | ||
%label{:for => "options[provider]-4"} database.com (login.database.com) | ||
%div{:"data-role" => "fieldcontain"} | ||
%fieldset{:"data-role" => "controlgroup"} | ||
%legend Display | ||
%input{:type => "radio", :name => "options[display]", :id => "options[display]-1", :value => "page", :checked => true} | ||
%label{:for => "options[display]-1"} page: full-page authorization screen | ||
%input{:type => "radio", :name => "options[display]", :id => "options[display]-2", :value => "popup"} | ||
%label{:for => "options[display]-2"} popup: compact dialog optimized for modern web browser popup windows. | ||
%input{:type => "radio", :name => "options[display]", :id => "options[display]-3", :value => "touch"} | ||
%label{:for => "options[display]-3"} touch: mobile-optimized dialog designed for modern smartphones, such as Android and iPhone. | ||
%fieldset{:"data-role" => "controlgroup"} | ||
%legend Access Level | ||
- default_scopes = Set.new(%w(api id refresh_token)) | ||
- %w(api chatter_api full id refresh_token visualforce web).each do |scope| | ||
%input{:type => "checkbox", :name => "options[scope|#{scope}]", :id => "options[scope|#{scope}]", :class => "custom", :checked => default_scopes.include?(scope)} | ||
%label{:for => "options[scope|#{scope}]"} #{scope} | ||
%div{:"data-role" => "fieldcontain"} | ||
%label{:for => "options[immediate]"} Immediate | ||
%select{:id => "options[immediate]", :name => "options[immediate]", :"data-role" => "slider"} | ||
%option{:value => "false"} No | ||
%option{:value => "true"} Yes | ||
- else | ||
%h3 You've been authenticated as: | ||
%div{:class => "ui-body"} | ||
%img{:align => "left", :src => session[:auth_hash][:info][:image], :style => "margin-right: 12px"} | ||
%strong #{session[:auth_hash][:info][:name]} | ||
%br | ||
#{session[:auth_hash][:extra][:username]} | ||
%br | ||
#{session[:auth_hash][:extra][:organization_id]} | ||
%br | ||
#{session[:auth_hash][:extra][:instance_url]} | ||
%a{:"data-role" => "button", :"data-ajax" => "false", :href => "/unauthenticate"} Log out (from this app only, not salesforce.com) | ||
%div{:class => "ui-body"} | ||
= htmlize_hash("ENV['omniauth.auth']",session[:auth_hash]) | ||
%a{:href => "https://github.com/richardvanhook/omniauth-salesforce-example"} | ||
%img{:style => "position: absolute; top: 0; right: 0; border: 0;", :src => "https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png", :alt => "Fork me on GitHub"} | ||
:javascript | ||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); | ||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); | ||
:javascript | ||
try{ | ||
var pageTracker = _gat._getTracker("UA-31738053-1"); | ||
pageTracker._trackPageview(); | ||
} catch(err) {} | ||
- if session[:auth_hash] == nil | ||
%h3 You are NOT authenticated. | ||
%a{:"data-role" => "button", :"data-ajax" => "false", :href => "#", :onclick => "document.authenticate_form.submit();"} Authenticate using your salesforce credentials | ||
%form{:id => "authenticate_form", :name => "authenticate_form", :action => "/authenticate", :method => "post"} | ||
%div{:class => "ui-body"} | ||
%div{:"data-role" => "collapsible", :"data-collapsed" => "true", :"data-theme" => "b", :"data-content-theme" => "c"} | ||
%h3 Authentication Options | ||
%p | ||
%div{:"data-role" => "fieldcontain"} | ||
%fieldset{:"data-role" => "controlgroup"} | ||
%legend Environment | ||
%input{:type => "radio", :name => "options[provider]", :id => "options[provider]-1", :value => "salesforce", :checked => true} | ||
%label{:for => "options[provider]-1"} production (login.salesforce.com) | ||
%input{:type => "radio", :name => "options[provider]", :id => "options[provider]-2", :value => "salesforcesandbox"} | ||
%label{:for => "options[provider]-2"} sandbox (test.salesforce.com) | ||
%input{:type => "radio", :name => "options[provider]", :id => "options[provider]-3", :value => "salesforceprerelease"} | ||
%label{:for => "options[provider]-3"} pre-release (prerellogin.pre.salesforce.com) | ||
%input{:type => "radio", :name => "options[provider]", :id => "options[provider]-4", :value => "databasedotcom"} | ||
%label{:for => "options[provider]-4"} database.com (login.database.com) | ||
%div{:"data-role" => "fieldcontain"} | ||
%fieldset{:"data-role" => "controlgroup"} | ||
%legend Display | ||
%input{:type => "radio", :name => "options[display]", :id => "options[display]-1", :value => "page", :checked => true} | ||
%label{:for => "options[display]-1"} page: full-page authorization screen | ||
%input{:type => "radio", :name => "options[display]", :id => "options[display]-2", :value => "popup"} | ||
%label{:for => "options[display]-2"} popup: compact dialog optimized for modern web browser popup windows. | ||
%input{:type => "radio", :name => "options[display]", :id => "options[display]-3", :value => "touch"} | ||
%label{:for => "options[display]-3"} touch: mobile-optimized dialog designed for modern smartphones, such as Android and iPhone. | ||
%fieldset{:"data-role" => "controlgroup"} | ||
%legend Access Level | ||
- default_scopes = Set.new(%w(api id refresh_token)) | ||
- %w(api chatter_api full id refresh_token visualforce web).each do |scope| | ||
%input{:type => "checkbox", :name => "options[scope|#{scope}]", :id => "options[scope|#{scope}]", :class => "custom", :checked => default_scopes.include?(scope)} | ||
%label{:for => "options[scope|#{scope}]"} #{scope} | ||
%div{:"data-role" => "fieldcontain"} | ||
%label{:for => "options[immediate]"} Immediate | ||
%select{:id => "options[immediate]", :name => "options[immediate]", :"data-role" => "slider"} | ||
%option{:value => "false"} No | ||
%option{:value => "true"} Yes | ||
- else | ||
%h3 You've been authenticated as: | ||
%div{:class => "ui-body"} | ||
%img{:align => "left", :src => session[:auth_hash][:info][:image], :style => "margin-right: 12px"} | ||
%strong #{session[:auth_hash][:info][:name]} | ||
%br | ||
#{session[:auth_hash][:extra][:username]} | ||
%br | ||
#{session[:auth_hash][:extra][:organization_id]} | ||
%br | ||
#{session[:auth_hash][:extra][:instance_url]} | ||
%a{:"data-role" => "button", :"data-ajax" => "false", :href => "/unauthenticate"} Log out (from this app only, not salesforce.com) | ||
%div{:class => "ui-body"} | ||
= htmlize_hash("ENV['omniauth.auth']",session[:auth_hash]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
!!! 5 | ||
%html{ :lang => "en"} | ||
%head | ||
%title= "omniauth salesforce example" | ||
%meta{ :name => "viewport", :content => "width=device-width, initial-scale=1"} | ||
%link{ :href => url("/jquery.mobile-1.1.0.css"), :media => "screen", :rel => "stylesheet", :type => "text/css" } | ||
%script{ :src => url("/jquery-1.7.2.min.js")} | ||
%script{ :src => url("/jquery.mobile-1.1.0.js")} | ||
%body | ||
#page{:"data-role" => "page", :"data-title" => "omniauth salesforce example"} | ||
#header{ :"data-role" => "header"} | ||
%h1 omniauth salesforce example | ||
#content{ :"data-role" => "content"} | ||
= yield | ||
%a{:href => "https://github.com/richardvanhook/omniauth-salesforce-example"} | ||
%img{:style => "position: absolute; top: 0; right: 0; border: 0;", :src => "https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png", :alt => "Fork me on GitHub"} | ||
:javascript | ||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); | ||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); | ||
:javascript | ||
try{ | ||
var pageTracker = _gat._getTracker("UA-31738053-1"); | ||
pageTracker._trackPageview(); | ||
} catch(err) {} |