'Create an oauth client application that is confidential.'

def create_confidential_client(self, name, user, redirect_uri, client_id=None, authorization_grant_type=models.Application.GRANT_AUTHORIZATION_CODE):

    return models.Application.objects.create(name=name, user=user, client_id=client_id, client_type=models.Application.CLIENT_CONFIDENTIAL, authorization_grant_type=authorization_grant_type, redirect_uris=redirect_uri)
