Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is this code in models. py not executed when logout? #85

Closed
zxbzxb180 opened this issue Jul 30, 2019 · 3 comments
Closed

Why is this code in models. py not executed when logout? #85

zxbzxb180 opened this issue Jul 30, 2019 · 3 comments

Comments

@zxbzxb180
Copy link

code:

 def request_sign_out(self, session=requests):
        """
        Send a POST request to the ``ServiceTicket``s logout URL to
        request sign-out.
        """
        if logout_allowed(self.service):
            request = SingleSignOutRequest(context={'ticket': self})
            url = get_logout_url(self.service) or self.service
            session.post(url, data={'logoutRequest': request.render_content()})
            logger.info("Single sign-out request sent to %s" % `url)```

I configured MAMA_CAS_ENABLE_SINGLE_SIGN_OUT=True in settings.py
and:

MAMA_CAS_SERVICES = [
    {        
        'SERVICE': 'http://127.0.0.1:8000/',
        'CALLBACKS': [
            'mama_cas.callbacks.user_model_attributes',
        ],
        'LOGOUT_ALLOW': True,
        'LOGOUT_URL': 'http://127.0.0.1:30000/logout',
    },
]

Thank you very much for your answer.

@stsewd
Copy link
Contributor

stsewd commented Aug 7, 2019

What lib are you using in the client?

@stsewd
Copy link
Contributor

stsewd commented Aug 7, 2019

I found that https://github.com/kstateome/django-cas/ doesn't work, because it calls to login() fater getting the ticket. That call update the last_login attr from the user. Then this problems happens #83

@zxbzxb180
Copy link
Author

zxbzxb180 commented Aug 7, 2019

你在客户端使用什么库?
I use django-cas-ng,
My problem has been solved. Because LOGOOUT_URL needs to be written as'LOGOUT_URL': 'http://127.0.0.1:30000/callback'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants