Zren / plasma-applet-eventcalendar

https://store.kde.org/p/998901/
469 stars 93 forks source link

Google calendar access disabled #339

Open szucskrisztian opened 1 year ago

szucskrisztian commented 1 year ago

When I try to connect to Gcal and click on the link in the widget settings, the browser opens and say that the request is invalid and I should contact with the developer.

Issue details: "400 hibakód: invalid_request The out-of-band (OOB) flow has been blocked in order to keep users secure. Follow the Out-of-Band (OOB) flow migration guide linked in the developer docs below to migrate your app to an alternative method. A kérelem adatai: redirect_uri=urn:ietf:wg:oauth:2.0:oob"

mkwsnyder commented 1 year ago

I got something similar, albeit more generic:

You can’t sign in because KDE Event Calendar Widget sent an invalid request. You can try again later, or contact the developer about this issue. Learn more about this error If you are a developer of KDE Event Calendar Widget, see error details. Error 400: invalid_request

szucskrisztian commented 1 year ago

r

And have you found any solution?

mkwsnyder commented 1 year ago

I have not; from the error message you got it sounds like Google changed how third party apps need to authenticate. Hopefully it won't be too difficult of a change, but without digging into the code and Google's documentation (something I can't do for a week or two) I'm not sure.

I even tried copying over the authentication token found in ~/.config/plasma-org.kde.plasma.desktop-appletsrc from a machine I'd previously authenticated on and that didn't work.

Edit: it appears this is a duplicate issue of both #331 and #333 so I'd recommend closing it. It looks like what I tried above is working for some people in said issues; I'd recommend trying it yourself to see if it works.

etoven commented 1 year ago

Yea having the same issue

etoven commented 1 year ago

I have not; from the error message you got it sounds like Google changed how third party apps need to authenticate. Hopefully it won't be too difficult of a change, but without digging into the code and Google's documentation (something I can't do for a week or two) I'm not sure.

I even tried copying over the authentication token found in ~/.config/plasma-org.kde.plasma.desktop-appletsrc from a machine I'd previously authenticated on and that didn't work.

Edit: it appears this is a duplicate issue of both #331 and #333 so I'd recommend closing it. It looks like what I tried above is working for some people in said issues; I'd recommend trying it yourself to see if it works.

That's not a fix if you cannot recover a token from a existing install.

mkwsnyder commented 1 year ago

That's not a fix if you cannot recover a token from a existing install.

I agree, it's a temporary band-aid solution until the project owner can implement an actual fix. I'm simply mentioning it here so that it can help those that do have an existing install.

FeryET commented 1 year ago

Have the same issue. Is there anyway to genereate the token manually?

etoven commented 1 year ago

I don't think so.

On Wed, Dec 7, 2022 at 2:56 AM Farhood @.***> wrote:

Have the same issue. Is there anyway to genereate the token manually?

— Reply to this email directly, view it on GitHub https://github.com/Zren/plasma-applet-eventcalendar/issues/339#issuecomment-1340542082, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5F5KF3E56Z2NJHADWDPZLWMA7LLANCNFSM6AAAAAAST3XXMQ . You are receiving this because you commented.Message ID: @.***>

-- Erich Toven AS, BS, Security+, CIW, CIW WFA

JackDinn commented 1 year ago

Please just fix. Iv tried all other calenders and they all have something that stops me from using them.

I wont be holding my breath.

etoven commented 1 year ago

He probably doesn't want to spin up a server or pay for api access anymore.

On Tue, Dec 13, 2022, 8:53 AM JackDinn @.***> wrote:

Please just fix. Iv tried all other calenders and they all have something that stops me from using them.

I wont be holding my breath.

— Reply to this email directly, view it on GitHub https://github.com/Zren/plasma-applet-eventcalendar/issues/339#issuecomment-1348610308, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5F5KFPJ6J6ZDOZMCW63JLWNB5WZANCNFSM6AAAAAAST3XXMQ . You are receiving this because you commented.Message ID: @.***>

cognitus commented 1 year ago

@Zren is possible fix this?

cruz94 commented 1 year ago

same issue here @Zren

TassieDevyl commented 1 year ago

Like many others, I'm experiencing the same problem.

It was mentioned in another thread that the code can be extracted from a config file and re-entered as a work around.

Which is good to know.

Unfortunately I did a completely fresh install, after some hardware upgrades.

Reformatted the old HDD and no longer have access to the file in question.

Which brings to mind a question, despite some recent changes in the last 4 months, (translation), is this applet actively maintained anymore?

Perhaps there is an active fork?

Anyone have any insights?

tategotoazarasi commented 1 year ago

Same issue.

rosenblueh commented 1 year ago

The akonadi stuff can synchronize with google calendar, so maybe via that...

Evgeny-del commented 1 year ago

скрин

deivid11 commented 1 year ago

Same issue here, cannot use google calendar sync

wokawoka commented 1 year ago

I'm experiencing the same problem :(

mcasaccio commented 1 year ago

same issue here image

tomholvey commented 1 year ago

I'm also seeing this issue

jackmonty commented 1 year ago

I'm also seeing this issue.

Sriramgireesh commented 1 year ago

I am also facing this issue

MoarcyVega commented 1 year ago

I've found a way to show my events from google calendar: It works to import them from kalendar (because of kdepim-addons). The only thing that doesn't work this way: If you have a few calendars in your google calendar with different colors, the events don't get the color from your google calendar.

So i still hope for a fix.

Evgeny-del commented 1 year ago

https://github.com/Zren/plasma-applet-eventcalendar/issues/339#issuecomment-1396653697 Не могли бы Вы подробнее рассказать об этом способе, который Вы нашли?

ruanpereira commented 1 year ago

same issue, invalid request when clicking in the link

ruanpereira commented 1 year ago

you can do it with korganizer, but isn't the same thing

HornetoMano commented 1 year ago

How you do this bro?

miko-techsys commented 1 year ago

#339 (comment) Не могли бы Вы подробнее рассказать об этом способе, который Вы нашли?

Install kdepim-addons and kde kalendar. Import your google calendar into kde kalendar and after this import from widget like PIM events.

ruanpereira commented 1 year ago

@HornetoMano just like @ArTikOnesh said. With KDE kalendar, go to the settings and add your google account with the events. Go back and activate the PIM events. If you use a KDE desktop environment, the PIM events can be activated in the configuration of the clock.

Salvaju29ro commented 1 year ago

@HornetoMano just like @ArTikOnesh said. With KDE kalendar, go to the settings and add your google account with the events. Go back and activate the PIM events. If you use a KDE desktop environment, the PIM events can be activated in the configuration of the clock.

Is Google working again with Akonadi? I switched to Event Calendar because Kalendar didn't let me add events to Google (Korganizer also didn't let me)

kanocz commented 1 year ago

tried changed obb to localhost method... changed redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob to redirect_uri=http%3A%2F%2F127.0.0.1:8080 and created small golang http server to get result code:


import (
  "fmt"
  "net/http"
  "log"
  "html"
)

type httpDump struct {

}

func (httpDump) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    r.ParseForm()

    fmt.Fprintf(w, "Code: %s", r.FormValue("code"))

    fmt.Printf("URL, %q\n", html.EscapeString(r.URL.Path))
    fmt.Printf("Form: %+v\n", r.Form)
    fmt.Printf("Headers: %+v\n", r.Header)

}

func main() {

  log.Fatal(http.ListenAndServe(":8080", httpDump{}))

}

It allows me to authorize, I'm getting code back... but after inserting in configuration text filed I'm getting this: image

anyone has better ideas? :)

kanocz commented 1 year ago

oh... it's 2-phase... after code we need to fetch access token... this part also have to be modified... will try to solve this later today

kanocz commented 1 year ago

Proof-of-concept idea works! :partying_face: With many manual steps for now, but.... I'm almost happy :)

image

materemias commented 1 year ago

if you could create a MR it'd be great

kanocz commented 1 year ago

if you could create a MR it'd be great

I'll try, but don't know how much time it'll take :( I need to read documentation about plasmoid development, is there any build-in http server in QML or if I can use some C++/go/rust code and connect it to QML script... or at least if it's possible to exec external app and get back it's output to automate all tasks I've done manually

kanocz commented 1 year ago

so... just finished temporary working solution... with little bit less manual steps :)

cli tool in golang https://github.com/kanocz/plasma-applet-eventcalendar/blob/master/google-oauth-helper/local-http.go

just download it, and run as go run local-http.go (you need to have golang installed) it will parse your event-plasmoid configuration, then generate URL and print it (in console) copy-paste it (or CTRL+click if you use konsole) then auth as always and then it will print config for plasmoid just in browser... you'll need to copy-paste it to your .config/plasma-org.kde.plasma.desktop-appletsrc and then probably logout-login

works for me, hope that will work for you also P.S.: probably I'll integrate/automate it later, probably not :)

bigo72 commented 1 year ago

so... just finished temporary working solution... with little bit less manual steps :)

cli tool in golang https://github.com/kanocz/plasma-applet-eventcalendar/blob/master/google-oauth-helper/local-http.go

just download it, and run as go run local-http.go (you need to have golang installed) it will parse your event-plasmoid configuration, then generate URL and print it (in console) copy-paste it (or CTRL+click if you use konsole) then auth as always and then it will print config for plasmoid just in browser... you'll need to copy-paste it to your .config/plasma-org.kde.plasma.desktop-appletsrc and then probably logout-login

works for me, hope that will work for you also P.S.: probably I'll integrate/automate it later, probably not :)

@kanocz you're great! Anyway I've got an error by golang: go run local-http.go local-http.go:1:3: expected 'package', found 1 what it means? Am I making any mistake?

kanocz commented 1 year ago

@kanocz you're great! Anyway I've got an error by golang: go run local-http.go local-http.go:1:3: expected 'package', found 1 what it means? Am I making any mistake?

it looks like you've copied file it with line numbers 😅 try to click on three dots and choose "view raw"

bigo72 commented 1 year ago

@kanocz you're great! Anyway I've got an error by golang: go run local-http.go local-http.go:1:3: expected 'package', found 1 what it means? Am I making any mistake?

it looks like you've copied file it with line numbers sweat_smile try to click on three dots and choose "view raw"

Ohmygod, I'm so noob! Thank you! It generated the link in Konsole but nothing else. I'm really sorry to bother you, but you are my only chance to solve this issue. It doesn't print any configuration in browser

kanocz commented 1 year ago

so you've opened this link in browser? can you post screenshot of what you see here?

bigo72 commented 1 year ago

Screenshot_6 Here it is. Translation:

Access blocked: authorization error

bigo72[at]gmail.com Missing required parameter: client_id Learn more about this error If you are a developer of this app, see the details of the error. Error 400: invalid_request

rnc commented 1 year ago

I have just tried this tool (although I still had a working accessToken) and it does correctly generate a new accessToken/accessTokenExpiresAt/accessTokenType and refreshToken values in the browser. I see it parses the existing .config/plasma-org.kde.plasma.desktop-appletsrc configuration looking for a [Configuration][Google Calendar] block - if I modify my existing configuration so that block doesn't exist then I can reproduce the above error. I am guessing @bigo72 does not have a correctly configured applet with a google calendar?

bigo72 commented 1 year ago

No, I was never able to config the applet with Google calendar. That's why I found this page. I'm on Garuda Linux with KDE

kanocz commented 1 year ago

yes, I need ClientToken and ClientSecret from existing config, so first you need open widget configuration and go to google calendar page... you don't need to click on URL there but at this moment widget will generate part of config I need to read

rnc commented 1 year ago

@kanocz It might be worth adding some error handling if sessionClientSecret and sessionClientId cannot be found in an existing config?

kanocz commented 1 year ago

sure :) it was just 10-minute quick coding... I'm going to vacation in few days and have very limited time... after I'll return I'll adjust code to automate process to few clicks and no manual copy and so on

kanocz commented 1 year ago

or maybe I'll found some time today-tomorrow - will try

miminno commented 1 year ago

yes, I need ClientToken and ClientSecret from existing config, so first you need open widget configuration and go to google calendar page... you don't need to click on URL there but at this moment widget will generate part of config I need to read

No matter how many times I try going to google calendar page in the settings, widget does not generate ClientToken and ClientSecret :( What's the secret?

kanocz commented 1 year ago

hm... strange... ok, I'll try to do better solution asap :) I've just found part of code how to execute external tool just from QML, so I'll pass clientID and clientSecret as arguments directly... and return config via stdout, so no copy-paste will be needed...

kanocz commented 1 year ago

ok.... https://github.com/Zren/plasma-applet-eventcalendar/pull/341 this fill just fix everything - no copy-paste needed and so on P.S.: you need to have golang installed before ./install executing, then you can remove it if you want