Created
May 12, 2019 16:54
-
-
Save rwehresmann/7091c0c635811bbad079802cd7b17c93 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| module Auth0 | |
| class Signin | |
| def self.perform(email, password) | |
| ctx = OpenSSL::SSL::SSLContext.new | |
| ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
| HTTP.headers(accept: 'application/json') | |
| .post( | |
| "https://#{ENV['AUTH0_DOMAIN']}/oauth/token", | |
| ssl_context: ctx, | |
| json: { | |
| grant_type: 'password', | |
| username: email, | |
| password: password, | |
| scope: 'openid', | |
| audience: ENV['AUTH0_AUDIENCE'], | |
| client_id: ENV['AUTH0_CLIENT_ID'], | |
| client_secret: ENV['AUTH0_CLIENT_SECRET'], | |
| } | |
| ) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment