-
Notifications
You must be signed in to change notification settings - Fork 34
OpenId Only Authentication
wlmcewen edited this page Nov 7, 2012
·
1 revision
This authentication option only allows access a user's Spark Platform identity without accessing any data (e.g. listings, contacts, etc.). Use this approach ONLY for when authenticating users through the Spark Platform, but not needing access to any of their data.
# initialize the gem with your key/secret.
# api_key, api_secret, and callback are all required.
# The following options are required:
# - api_key: Your client key
# - api_secret: Your client secret
# - callback: Your redirect_uri, which the end user will be redirected
# to after authorizing your application to access their data.
# - auth_endpoint: The URI to redirect the user's web browser to, in order for them to
# authorize your application to access their data.
# other options and their defaults:
# - user_agent: 'Spark API Ruby Gem'
SparkApi.configure do |config|
config.authentication_mode = SparkApi::Authentication::OpenId
config.api_key = "YOUR_CLIENT_ID"
config.api_secret = "YOUR_CLIENT_SECRET"
config.callback = "YOUR_REDIRECT_URI"
config.auth_endpoint = "https://sparkplatform.com/openid"
end
# Code is retrieved from the method:
# See script/combined_flow_example.rb for more details.
# Optionally, additional a GET parameters can be supplied as a hash to
# authorization_url.
# SparkApi.client.authenticator.authorization_url
# That's it! No API Access is available when using OpenID alone.