endpoints/getting-started/app.rb
# Retrieves the authenication information from Google Cloud Endpoints.
Retrieves the authenication information from Google Cloud Endpoints.
Retrieves the authenication information from Google Cloud Endpoints .
def auth_info
  encoded_info = request.env["HTTP_X_ENDPOINT_API_USERINFO"]
  if encoded_info
    info_json = Base64.decode64 encoded_info
    user_info = JSON.parse info_json
  else
    user_info = { id: "anonymous" }
  end
  user_info.to_json
end
def auth_info encoded_info = request . env [ "HTTP_X_ENDPOINT_API_USERINFO" ] if encoded_info info_json = Base64 . decode64 encoded_info user_info = JSON . parse info_json else user_info = { id : "anonymous" } end user_info . to_json end
Retrieves the authenication information from Google Cloud Endpoints.
Retrieves the authenication information from Google Cloud Endpoints .