{"action":"closed","issue":{"url":"https://api.github.com/repos/jkeyes/python-intercom/issues/117","repository_url":"https://api.github.com/repos/jkeyes/python-intercom","labels_url":"https://api.github.com/repos/jkeyes/python-intercom/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/jkeyes/python-intercom/issues/117/comments","events_url":"https://api.github.com/repos/jkeyes/python-intercom/issues/117/events","html_url":"https://github.com/jkeyes/python-intercom/issues/117","id":159961906,"number":117,"title":"Dynamic credentials","user":{"login":"jpocentek","id":8410171,"avatar_url":"https://avatars.githubusercontent.com/u/8410171?v=3","gravatar_id":"","url":"https://api.github.com/users/jpocentek","html_url":"https://github.com/jpocentek","followers_url":"https://api.github.com/users/jpocentek/followers","following_url":"https://api.github.com/users/jpocentek/following{/other_user}","gists_url":"https://api.github.com/users/jpocentek/gists{/gist_id}","starred_url":"https://api.github.com/users/jpocentek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpocentek/subscriptions","organizations_url":"https://api.github.com/users/jpocentek/orgs","repos_url":"https://api.github.com/users/jpocentek/repos","events_url":"https://api.github.com/users/jpocentek/events{/privacy}","received_events_url":"https://api.github.com/users/jpocentek/received_events","type":"User","site_admin":false},"labels":[{"id":345357657,"url":"https://api.github.com/repos/jkeyes/python-intercom/labels/awaiting-release","name":"awaiting-release","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-13T14:21:33Z","updated_at":"2016-11-16T22:54:35Z","closed_at":"2016-11-16T22:54:35Z","body":"Is it possible to use this package with different credentials for every request? It seem to get global configuration and it's impossible to change it at runtime. For example I'm trying to create function that will fetch data from given account, something like this:\n\n```\n@shared_task\ndef get_intercom_user(email=None, api_id=None, api_key=None):\n    if api_id is None or api_key is None:\n        raise ImproperlyConfigured(\"Intercom api keys required\")\n    elif email is None:\n        raise Exception(\"An email address is required\")\n    Intercom.app_id = api_id\n    Intercom.app_api_key = api_key\n    return User.find(email=email)\n```\n\nAnd I get `AuthenticationError: Unauthorized` error. It's Django implementation and it's working if settings are taken from config file during application startup, but not when they are passed dynamically into function in any way (or Celery task, it is only one of many tries).\n"}}
{"actor":{"display_login":"jkeyes"}}