Return the access information for an OAuth2 authorization grant.

        :param code: the code received in the request from the OAuth2 server
        :returns: A dictionary with the key/value pairs for ``access_token``,
            ``refresh_token`` and ``scope``. The ``refresh_token`` value will
            be None when the OAuth2 grant is not refreshable. The ``scope``
            value will be a set containing the scopes the tokens are valid for.

def get_access_information(self, code):
        """Return the access information for an OAuth2 authorization grant.

        :param code: the code received in the request from the OAuth2 server
        :returns: A dictionary with the key/value pairs for ``access_token``,
            ``refresh_token`` and ``scope``. The ``refresh_token`` value will
            be None when the OAuth2 grant is not refreshable. The ``scope``
            value will be a set containing the scopes the tokens are valid for.

        """
        if self.config.grant_type == 'password':
            data = {'grant_type': 'password',
                    'username': self.config.user,
                    'password': self.config.pswd}
        else:
            data = {'code': code, 'grant_type': 'authorization_code',
                    'redirect_uri': self.redirect_uri}
        retval = self._handle_oauth_request(data)
        return {'access_token': retval['access_token'],
                'refresh_token': retval.get('refresh_token'),
                'scope': set(retval['scope'].split(' '))}