class Redd::AuthStrategies::Script
A password-based authentication scheme. Requests all scopes.
Public Class Methods
new(client_id:, secret:, username:, password:, **kwargs)
click to toggle source
Calls superclass method
Redd::AuthStrategies::AuthStrategy::new
# File lib/redd/auth_strategies/script.rb, line 9 def initialize(client_id:, secret:, username:, password:, **kwargs) super(client_id: client_id, secret: secret, **kwargs) @username = username @password = password end
Public Instance Methods
authenticate()
click to toggle source
Perform authentication and return the resulting access object @return [Access] the access token object
# File lib/redd/auth_strategies/script.rb, line 17 def authenticate request_access('password', username: @username, password: @password) end
refresh(_)
click to toggle source
Refresh the authentication and return the refreshed access @return [Access] the new access
# File lib/redd/auth_strategies/script.rb, line 23 def refresh(_) authenticate end