auth-token

How to make AccountManager (authtoken) and OpenID work together (without AppEngine)?

浪子不回头ぞ 提交于 2019-12-03 05:56:58
问题 I am making an Android app which should be able to get data from a web service (which is not part of GAE). Users are able to log in to web service through their browser by using OpenId (only Google accounts are allowed). AccountManager can give me authtoken. I could save this authtoken on my server, together with user's google account name (email) and then use this account name to connect his openid login with app registration. But this does not solve anything because I have no way to verify

How to retrieve an Facebook-AuthToken from the accounts saved on Android

我只是一个虾纸丫 提交于 2019-11-28 10:17:56
I'm trying to retrieve the AuthToken for Facebook (saved by Facebook for Android ) by using the following piece of code. AccountManager am = AccountManager.get(this); Account[] accounts = am.getAccountsByType("com.facebook.auth.login"); if (accounts.length > 0) { for(int j = 0; j < accounts.length; j++) { Account account = accounts[j]; if(account.type != null && account.type.equals("com.facebook.auth.login")) { Log.e(RuntimeVars.MY_NAME, "FACEBOOK-TYPE FOUND"); am.getAuthToken(account, "com.facebook.auth.login", null, ConversationList.this, new AccountManagerCallback<Bundle>() { public void

Best practices to invalidate JWT while changing passwords and logout in node.js? [closed]

放肆的年华 提交于 2019-11-27 16:38:26
I would like to know the best practices to invalidate JWT without hitting db while changing password/logout. I have the idea below to handle above 2 cases by hitting the user database. 1.Incase of password changes, I check for password(hashed) stored in the user db. 2.Incase of logout, I save last-logout time in user db, hence by comparing the token created time and logout time, I can able to invalidate this case. But these 2 cases comes at the cost of hitting user db everytime when the user hits the api. Any best practise is appreciated. UPDATE: I dont think we can able to invalidate JWT

How do you authenticate a websocket with token authentication on django channels?

为君一笑 提交于 2019-11-27 12:05:27
问题 We want to use django-channels for our websockets but we need to authenticate as well. We have a rest api running with django-rest-framework and there we use tokens to authenticate a user, but the same functionality does not seem to be built into django-channels. 回答1: For Django-Channels 2 you can write custom authentication middleware https://gist.github.com/rluts/22e05ed8f53f97bdd02eafdf38f3d60a token_auth.py: from channels.auth import AuthMiddlewareStack from rest_framework.authtoken