Git Product home page Git Product logo

Comments (17)

Clancey avatar Clancey commented on July 17, 2024

This doesn't happen with the sample.

from simpleauth.

goranmedic avatar goranmedic commented on July 17, 2024

@Clancey yes but sample uses google.Authenticate() , that works for me too, can you please try it with google.Get("https://www.googleapis.com/oauth2/v1/userinfo?alt=json");

from simpleauth.

Clancey avatar Clancey commented on July 17, 2024

Still works for me. Does it work for you in the sample?

from simpleauth.

goranmedic avatar goranmedic commented on July 17, 2024

It works for me too in the sample.
The problem is that in my app,

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            SimpleAuth.Native.OnActivityResult(requestCode, resultCode, data);
        }

is called 3 times instead of just 1, I'm not sure why.

from simpleauth.

Clancey avatar Clancey commented on July 17, 2024

Try checking the data, see what is passed in, are the all the same?That shouldn't cause any weird artifacts.All the callbacks come from outside my realm. I can't control theOnActiviytResult

from simpleauth.

Kevvix avatar Kevvix commented on July 17, 2024

Hi,

I got the same problem (flashing 3 times) today by mistake.
I got the problem when I try to pass a "ClientSecretID" to GoogleAPI constructor like :

var ClientSecretID = "YDS2t7_w8A8SQ15P1RMVfAzy"
var api = new GoogleApi("google", GoogleClientId, ClientSecretID)

but the problem been solve when I use the hardcoder value "GoogleApi.NativeClientSecret" as :

var api = new GoogleApi("google", GoogleClientId, GoogleApi.NativeClientSecret)

Hope it can be usefull

(my English isn't as good as I want)

from simpleauth.

goranmedic avatar goranmedic commented on July 17, 2024

@Kevvix , so you're saying that I should try something like this

var api = new GoogleApi("google", GoogleClientId, "YDS2t7_w8A8SQ15P1RMVfAzy")
I'll try that on Monday, thank you for your response.

from simpleauth.

goranmedic avatar goranmedic commented on July 17, 2024

using api = new GoogleApi("google", GoogleClientId, GoogleApi.NativeClientSecret)
instead of api = new GoogleApi("google", GoogleClientId, GoogleSecret) fixed my problem.
@Kevvix, @Clancey thank you.

from simpleauth.

Clancey avatar Clancey commented on July 17, 2024

I will dig in a little more and see if I can find the issue.

from simpleauth.

Clancey avatar Clancey commented on July 17, 2024

I still cannot reproduce this. I have tried exactly as you guys have said, Also there is no difference between

api = new GoogleApi("google", GoogleClientId)
and
api = new GoogleApi("google", GoogleClientId, GoogleApi.NativeClientSecret)

from simpleauth.

goranmedic avatar goranmedic commented on July 17, 2024

I'm not sure why it works, but it works.

Also I'm using MainPage as login page, not App.cs like sample.
Rest of the code is pretty much the same as one in the sample.

from simpleauth.

goranmedic avatar goranmedic commented on July 17, 2024

@Clancey have you tried it like this?

string googleSecret = "some secret";
string GoogleClientId = "some client id";
api = new GoogleApi("google", GoogleClientId, googleSecret);

from simpleauth.

Clancey avatar Clancey commented on July 17, 2024

Yes I did. Still can't duplicate. So you want to try and debug it?

from simpleauth.

goranmedic avatar goranmedic commented on July 17, 2024

@Clancey can you explain me how can I use refresh_token to obtain new access_token once the old one expires (in 1hour) ?

from simpleauth.

Clancey avatar Clancey commented on July 17, 2024

You don't have too. The lib shows it for you. Just make a web call or manually call API.Authenticate();

from simpleauth.

goranmedic avatar goranmedic commented on July 17, 2024

@Clancey thank you for your response.
The problem is I'm not supposed to prompt user to login again.
I have a periodic task that executes at some period in background and it requires account.IdToken.
Is there any way to automatically use refresh_token to obtain new tokens ?

from simpleauth.

Clancey avatar Clancey commented on July 17, 2024

If you don't pass in the web server client secret, the native google deals with all refreshing. SimpleAuth will ask them for the new token, and sometimes they will show the UI. If you do the secret, it will auto refresh perfectly.

from simpleauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.