class Owner

**************************************************************************

**************************************************************************

Public Class Methods

process_bearer_request(params,env,action) click to toggle source

Processes the /token and /invalidate_token endpoint and returns the required doauth details.

# File lib/modules/models/owner.rb, line 45
def self.process_bearer_request(params,env,action)
  flag, void_value = Oauth2Client.valid_authorization?(params)
              if flag && void_value == "present"
    case action
    when "bearer_token"
                  expected_response,response_message = Oauth2Client.grant_access(params,env,"bearer")
    when "invalidate"
      expected_response,response_message = Oauth2Client.invalidate_token(params,env)
    end
    return expected_response,response_message
        elsif void_value == "present"
                      error = "Invalid authorization code"
                      error_response = Oauth2Authorization.error_response(error) 
    return error_response,false
              else
                error = "Invalid client id"
                      error_response = Oauth2Authorization.error_response(error) 
    return error_response,false
              end
end

Public Instance Methods

oauth2_authorization(client,owner) click to toggle source

Returns oauth details for specified client id and owner id.

# File lib/modules/models/owner.rb, line 39
def oauth2_authorization(client,owner)
  Oauth2Authorization.find_by_oauth2_client_id_and_oauth2_resource_owner_id(client.id,owner.id)
end
oauth2_authorization_for(client) click to toggle source

Returns oauth details for specified client id.

# File lib/modules/models/owner.rb, line 33
def oauth2_authorization_for(client)
  Oauth2Authorization.find_by_oauth2_client_id(client.id)
end