FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
oauth-api-example/example.rb at main · controlshift/oauth-api-example · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
controlshift
/
oauth-api-example
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
oauth-api-example
/
example.rb
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (13 loc) · 653 Bytes
Breadcrumbs
oauth-api-example
/
example.rb
Copy path
File metadata and controls
17 lines (13 loc) · 653 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require
'oauth2'
# START CONFIGURATION SETTINGS
# Replace these variable values with values for your instance of your platform.
client_id
=
'xxabc123'
client_secret
=
'xxabc123'
# Replace this with your platform URL
controlshift_url
=
'https://demo.controlshiftlabs.com'
# END CONFIGURATION SETTINGS
client
=
OAuth2
::
Client
.
new
(
client_id
,
client_secret
,
site
:
controlshift_url
)
token
=
client
.
client_credentials
.
get_token
response
=
token
.
get
(
'/api/v1/members/lookup'
,
params
:
{
'email'
=>
'woodhull@gmail.com'
}
)
# This will print the response. You likely want to do something else useful with this information.
puts
json
=
JSON
.
parse
(
response
.
body
)
Back
|
FazBrowse Home
|
New Git URL