Skip to content

Error got OAuth2::Error: invalid_client: The client credentials are invalid #1

Description

@swellinteractive

def self.refresh_token
token = BoxClient.get_token
session = build_session(token)
new_token = session.refresh_token(token.refresh_token)
token.update_attributes!(access_token: new_token.token, refresh_token: new_token.refresh_token)
end

def self.build_session(token = nil)
token ||= BoxClient.get_token
client_params = {
client_id: configatron.box.client_id,
client_secret: configatron.box.client_secret,
access_token: token.access_token,
}
RubyBox::Session.new(client_params)
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions