Method: OpenC3::ScriptServerProxy#generate_auth

Defined in:
lib/openc3/script/script.rb

#generate_authObject

generate the auth object



293
294
295
296
297
298
299
300
301
302
303
# File 'lib/openc3/script/script.rb', line 293

def generate_auth
  if ENV['OPENC3_API_TOKEN'].nil? and ENV['OPENC3_API_USER'].nil?
    if ENV['OPENC3_API_PASSWORD'] || ENV['OPENC3_SERVICE_PASSWORD']
      return OpenC3Authentication.new()
    else
      return nil
    end
  else
    return OpenC3KeycloakAuthentication.new(ENV['OPENC3_KEYCLOAK_URL'])
  end
end