Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user_token para autenticar #2

Open
virgiliodantas opened this issue Oct 7, 2020 · 0 comments
Open

user_token para autenticar #2

virgiliodantas opened this issue Oct 7, 2020 · 0 comments

Comments

@virgiliodantas
Copy link

no arquivo
glpi-sdk-ruby/lib/glpi/sdk/session.rb

na linha 8:
#def initialize(url, app_token, username, password)
def initialize(url, app_token, authorization)
@url = url
@app_token = app_token
#@auth = { username: username, password: password }
@auth = 'user_token: '+ authorization
init
end

adicionar na linha 55:
options[:headers] = options.fetch(:headers, {})
options[:headers]['Content-Type'] = 'application/json'
options[:headers]['App-Token'] = @app_token
options[:headers]['Authorization'] = @auth
options[:headers]['Session-Token'] = @token if @token

na utilização da gem adicionar as duas linhas:

authorization = 'user_token gerado pelo próprio usuário'
session = GLPI::SDK::Session.new(url, app_token, authorization)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant