How can I use Django OAuth Toolkit with Python Social Auth?

A lot of the difficulty in implementing OAuth comes down to understanding how the authorization flow is supposed to work. This is mostly because this is the “starting point” for logging in, and when working with a third-party backend (using something like Python Social Auth) you are actually doing this twice: once for your API … Read more

Multiple Scope Values to oauth2

You were on the right track when you combined them to a single field . There should be only one scope parameter in the request, with the values separated by spaces. If you’re putting it in a form like that, the browser will take care of encoding the space for you. <input type=”hidden” name=”scope” value=”https://www.googleapis.com/auth/calendar … Read more

Authenticating with OAuth2 for an app *and* a website

I just posted an answer to a similar StackOverflow question. Google calls this Hybrid Apps and explains how an “Android app obtains offline access for Web back-end”. The gist of it is that you’ll have to pass a massaged scope string into GoogleAuthUtil.getToken in order to get it to return an Authorization Code (not an … Read more

How to identify a Google OAuth2 user?

As others have mentioned, you can send a GET to https://www.googleapis.com/oauth2/v3/userinfo, using the OAuth2 bearer token you just received, and you will get a response with some information about the user (id, name, etc.). It’s also worth mentioning that Google implements OpenID Connect and that this user info endpoint is just one part of it. … Read more

How to specify refresh tokens lifespan in Keycloak

As pointed out in the comments by @Kuba Šimonovský the accepted answer is missing other important factors: Actually, it is much much much more complicated. TL;DR One can infer that the refresh token lifespan will be equal to the smallest value among (SSO Session Idle, Client Session Idle, SSO Session Max, and Client Session Max). … Read more

Using bearer tokens and cookie authentication together

I think I worked this out:- Startup.Auth is wiring up the OWIN pipeline, so it is right to include Cookies and Tokens there. But one change to the cookie options specifies the authentication type it should apply to: CookieOptions = new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie }; Then I needed to configure WebAPI to only … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)