Skip to content

Instantly share code, notes, and snippets.

@stereosupersonic
Last active March 21, 2016 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stereosupersonic/8dbb8bca20f461c3b342 to your computer and use it in GitHub Desktop.
Save stereosupersonic/8dbb8bca20f461c3b342 to your computer and use it in GitHub Desktop.
class Flservice::CoreUser::User < OpenStruct
PATH = "/v1/profile"
def self.find(uid)
response = connection(uid).get PATH
self.new JSON.parse(response.body)["user"].except("authentications")
end
def self.connection(uid)
url = "http://0.0.0.0:3000" # TODO RemoteApp.new(:core_user)
auth_token = FL::Core::Auth::IdToken.generate(user_id: uid)
Faraday.new(url: url") do |faraday|
faraday.request :url_encoded
faraday.adapter :excon
faraday.headers['Authorization']="Bearer #{auth_token}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment