Why django user created via google auth without social application token? - django

enter image description hereUsing django-allauth users signed-in via google API, but social application token is not being created, how to get it?

FIX:
In your project settings.py file add SOCIALACCOUNT_STORE_TOKENS = True. Its default is set to False, as seen in the bottom of the configuration documentation.
Had the exact same problem, (probably) due to following old tutorials. Hope this works for you!

Related

Is there any superset API to open dashboard?

I have been using superset. I want to bypass the login page. To do so I did the following in a js file
Got token using login API
Got dashboard URL using dataset find API
I have tried to open the dashboard url and I am getting login page eventhough I already hit login API to get the tokens. I want to know is there any way or build in API in superset to open the superset dashboard bypassing the login page.
Thank you for your support. I have implemented SSO in superset. I have done the following things hope it might be helpful for others.
Inside security folder create your own login/logout method inside init.py file.
Update CUSTOM_SECURITY_MANAGER from None to your custom class(defined inside security folder).
I have followed this link https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/security/manager.py.

Django drf-social-oauth2 Social Signup fallback login

I am trying to create a SPA, and want enable to Google Sign In/Sign Up.
Is there a way to click Sign In with Google and:
First try to Sign Up
If the user already exists, login and return access token else create the user and then return the access token
I also use drf-social-oauth2
I am the main maintainer of https://github.com/wagnerdelima/drf-social-oauth2. Did you try reading the README file? There are instructions there on how to authenticate with Google. There are also a few issues where people managed to use Google successfully.
Here, you can check this closed issue: https://github.com/wagnerdelima/drf-social-oauth2/issues/38.

Issue when trying to register an app for consent screen in google oauth

I am trying to register my app for Oauth consent screen, so that I can create a OAuth client ID. I keep getting this validation error at end of the form, even though I have submitted everything correctly.
An error occurred while saving your app
And this error does not state which input in the form is invalid. Also in the network tab of development tools window, everytime I submit the request, I can see a POST request being initiated and it fails with following error.
{"error":{"code":3,"message":"The request failed because one of the field of the resource is invalid.","details":[{"#type":"type.googleapis.com/google.rpc.PreconditionFailure","violations":[{"type":"client_auth_config","subject":"?error_code=9&error_field_name=UpdateBrandWithMaskRequest.brand_id&error_field_value=0"}]}]}}.
Any suggestions on how to fix this is highly appreciated. I have contacted the google support about this issue as well, but as of now they're saying everything works on their end and clear cache and cookies but it doesn't work. I have attached here a capture of consent config wizard I'm using as well.
Put the Project ID in App Name
Try adding your support email to Firebase console. Go to firebase console->settings->General->Support Email->Add Email. Now while creating oAuth consent screen add same email id developer contact information as well as support email. It worked for me.
To expand on the top answer, there are numerous underlying reasons why this step of the app registration would fail. In the case where the application name is not valid (fails any of the checks that Google Cloud Platform enforces), then setting the application name to the project ID is guaranteed to fix the problem, as the project ID will always happen to be a valid application name.
It may be worth digging into the underlying validation error, which can be achieved by inspecting the network request that is sent upon submitting the form. In the "Network" tab of the Developer Tools, select the POST request that is captured after clicking the "SAVE AND CONTINUE" button. The "Response" tab (shown below for my case) should display an error object with a more descriptive message.
In my case, it seems that the application name was deemed abusive:
The request has been classified as abusive and was not allowed to proceed.
which I suspect is because it contains the word "Google".
What #Kalind said helped me to resolve the problem.
So login to firebase console, chose the project you are trying to create an OAuth Consent too. And then click settings-> General-> Support Email-> Add Email from dropdown.
Now when I go back to google cloud console under the Oauth consent screen, I can see that I have one registered to that project.
I had the same problem, indeed your App name must be identical to your Project ID that you chose when creating the project
I got the exact same error, probably an issue on their end :/
Thanks for reporting this everyone. I've also had the same problem for different apps and #Kalind suggestion fixes the problem. On Firebase project's settings there's a new field now called "Support email" where you can select your support email address. This will fix your issue like #Kalind and #Kasper said. I'm just adding a screenshot to make it more clear for those with the same problem.
Thanks!
For me there was an email in there already (owner of account email).
I had to invite another email > accept invite > change email > save > then change back > then I could proceed with the OAuth Consent Screen.
To change the support email on the Firebase Console you go to:
https://console.firebase.google.com/ > select Cog > Project Settings > General tab > Support Email
I reached this page is because of testing Google Login.
I faced this issue creating "OAuth consent screen".
But I didn't need this to create.
Just go to "Domain verification" page and "Add Domain".
There you may need to add 'txt record' in DNS Setting to prove you owned the domain.
After adding domain, go to "Credentials" page.
It is ready to choose the "Application type" like google guide
!!! pls enjoy !!!
I used the app Id as my App Name in the OAuth consent screen setup page.
If you are trying to use group email from gsuite in App consent/Firebase support, you must be the group owner, and do not need that group email address on any IAM role.
I believe the name of the application requesting access simply needs to be different from the name of the Google project.
This Error was come due to the project name is the same as the app name. So your app name and project name must be differnet
to expand on the helpful post of #zr0gravity7
I checked the 'response' in the developer con{"error":
{"code":3,"message":"com.google.apps.framework.request.BadRequestException:
At least one field must be updated."}}
I simply changed one field, and the save now succeeded.
(This is a very disappointing design of the form error checking)
The app name must be unique across Google. Modify the app name a bit.

how do i configure and use django-allauth app for my application

I have installed the django-allauth application and started using it but i am facing problems like:
1) confused on urls.py configuration.
2) shows me no social apps registered if i go onto login via social apps like facebook
3) if at all i login sometimes then it directs me to a url having profile and nothing matched says.
please help,
thanks.
the app is called as:" https://github.com/pennersr/django-allauth"
For the second problem you have to log in to admin site, and add socialapp under Social apps.
So, for facebook you will add your app's secret id and key.

Django admin login page redirects to same page on correct login credentials

I'm running a relatively fresh Django app that I haven't added much to. I tried to set up the admin (which I've done on plenty of other apps) to create some sample data while I build out the app, but whenever I try to log in with the super user account I created I get kicked back to the login screen.
When I enter incorrect credentials, I see the proper error message... I just can't get it to take me past the login screen to the admin when I have correct credentials. Has anyone else had this problem and been able to solve it? I'm at a dead end troubleshooting.
Check that SESSION_COOKIE_SECURE is not set while you are not using HTTPS.
Looks like your cookies are messed up. Please start with clearing cookies in browser. If it doesn't help you can also check if your cookies configuration for project is correct. List of settings for cookies configuration can be found here.
Use the below settings for the SESSION_COOKIE_DOMAIN:
SESSION_COOKIE_DOMAIN = "yourdomain.com"