'Create and save a new access token.
Similar to OAuth 2, indication of granted scopes will be included as a
space separated list in ``oauth_authorized_realms``.
:param request: An oauthlib.common.Request object.
:returns: The token as an urlencoded string.'

def create_access_token(self, request, credentials):

    request.realms = self.request_validator.get_realms(request.resource_owner_key, request)
    token = {u'oauth_token': self.token_generator(), u'oauth_token_secret': self.token_generator(), u'oauth_authorized_realms': u'    '.join(request.realms)}
    token.update(credentials)
    self.request_validator.save_access_token(token, request)
    return urlencode(token.items())
