#Need help on MAL Auth
1 messages · Page 1 of 1 (latest)
You can press the "Close Post" button above or type /close at any time to close this post.
The following was shared by @reef tartan and was automatically redacted by Luma as it may have contained sensitive information.
Hey, I have an issue that drives me crazy, I can't get kometa authenticate on MAL on mac / docker / windows (WSL) on master branch
Generated config online (https://kometa.wiki/en/latest/config/myanimelist/#online-authorization) seems to work correctly but I cant get it to work in Kometa from a fresh config.yaml
I always have the following Invalid code error :
| Connecting to My Anime List... |
| Traceback (most recent call last): |
| File "/home/elio/Kometa/modules/mal.py", line 96, in __init__ |
| self._authorization() |
| File "/home/elio/Kometa/modules/mal.py", line 153, in _authorization |
| raise Failed("MyAnimeList Error: Invalid code") |
| modules.util.Failed: MyAnimeList Error: Invalid code |
| |
| MyAnimeList Error: Failed to Connect |
| My Anime List Connection Failed |
My config looks like this
mal:
client_id: (redacted by Luma)
client_secret: (redacted by Luma)
cache_expiration: 60
localhost_url: (redacted by Luma)
authorization:
# authorization section is autofilled by the script
access_token:
expires_in:
refresh_token:
token_type:
I've tried multiple localhost url generated by kometa but it doesn't seems to work
Thanks
this shows you on the trakt page
you need to click MyAnimeList on the top
yes this page works
It redirects on the first tab after auth
you can see the begining of MALAUTH at the end of the screenshot
What I can't get to work is the authentication in kometa itself
Odd that one works but not the other; they are both the very same code behind the scenes; I just copy-pasted from Kometa for the web-based one.
Can you try if the flow in kometa works for you ?
I think it worked few weeks ago when I conifgured kometa
When I get a chance, sure will.
All three workflows worked fine with one exception; the interactive method didn't wait for me to paste in the localhost URL, so I pasted it in the config file and just ran Kometa a second time which worked as expected.
Ok thanks a lot for your test, I will try again
I still can't get it to work wtf
I even created a second app on MAL but still getting an Invalid code.
Here is how I try it :
I fill my mal client_id and client_secret, run kometa
It ask me to go to https://myanimelist.net/v1/oauth2/authorize?response_type=code...
I allow the app, it redirect me on localhost.
I fill the localhost_url: http://localhost/?code=xxx
And then have this
| Connecting to My Anime List... |
| Traceback (most recent call last): |
| File "/home/elio/Kometa/modules/mal.py", line 96, in __init__ |
| self._authorization() |
| File "/home/elio/Kometa/modules/mal.py", line 153, in _authorization |
| raise Failed("MyAnimeList Error: Invalid code") |
| modules.util.Failed: MyAnimeList Error: Invalid code |
| |
| MyAnimeList Error: Failed to Connect |
| My Anime List Connection Failed |
!noredact
What's even weirder is that I'm able to make it work through the malauth script on the wiki !noredact
########## GENERATED BY MALAUTH ##########
mal:
client_id: xxx
client_secret: xxx
Created a new app:
Did the first workflow where I edited the URL and pasted it into the browser, that gave me a localhost URL which I pasted into the config; ran Kometa again and all filled in.
Ok I think it's the url generated by kometa that doesn't work
Replacing client_id in this worked !noredact
https://myanimelist.net/v1/oauth2/authorize?response_type=code&client_id=CLIENT_ID&code_challenge=k_UHwN_eHAPQVXiceC-rYGkozKqrJmKxPUIUOBIKo1noq_4XGRVCViP_dGcwB-fkPql8f56mmWj5aWCa2HDeugf6sRvnc9Rjhbb1vKGYLY0IwWsDNXRqXdksaVGJthux
Yes, you have to replace CLIENT_ID with your client ID as noted in the wiki.
https://metamanager.wiki/en/latest/config/myanimelist/#alternative-way-of-letting-kometa-make-the-url this doesnt seems to work
Kometa is an open-source python project allowing you to unlock the potential of your media server.
That just worked for me.
With the exception that it didn't wait for me to paste in the URL.
I had to paste it in to the config file and run Kometa again.
yes same, I need to open it manually
Yes, also as expected.
yeah it's not a problem
| Connecting to My Anime List... |
| Config Warning: mal sub-attribute cache_expiration is blank using 60 as default |
| |
| Navigate to: https://myanimelist.net/v1/oauth2/authorize?response_type=code&client_id=eb6f8650073dd...
| |
| Login and click the Allow option. You will then be redirected to a localhost |
| url that most likely won't load, which is fine. Copy the URL and paste it below |
I was running this is VS Code, which saw that URL and asked if I wanted to open it, but the display of the URL and then the user having to go there themselves is nothing new. This is the way the interactive thing has always worked.
yeah same
then I paste the localhost url
!noredact
mal:
client_id: 1351xxxx
client_secret: 1557xxxxx
cache_expiration: 60
localhost_url: http://localhost/?code=def5020003xxxxxxx
Seems like an issue on the MAL side, perhaps with the application you've created?
I added a logger.debug to see what the error code
Not sure, I can't make it fail so it seems unlikely to be purely a kometa code issue; there must be some environmental component
What's weird it's that I tried with 2 MAL apps
I also tried full vpn to see if there is smthg with my ip
But again external kometa generated localhost url seems to work
I will try on my mac
Here's the code behind those forms in the wiki if you want to try it totally outside the Kometa context.
It's pretty boring and basically cribbed straight from Kometa. Also unchanged since PMM days.
I tried to compare with the malauth script in Media-Scripts instead but the auth procedure looks similar
I don't know what I'm doing wrong for now
I will still try to finish my pr using modified url to generate the localhost url lol
Oh, is this failure in your modified code?
I was thinking so at first but went on master branch to check
If I replace
code_verifier = secrets.token_urlsafe(100)[:128]
by
code_verifier = uni_code_verifier
It works
I don't understand why there is a generation of a new string
Basically when the PKCE code_challenge is changed from the 'universal' one, I can't auth
chazlarson used !aenh
@reef tartan, anything else needed here? If not, please type /close and hit enter. Please respond within 24 hours of this message or it will be archived.
We can close it but issue is still present, when the code_challenge is change from the one from the wiki, weirdly I can't auth
Works fine here; yours is the first report of this I've seen, anyway, and this code is unchanged in a long time.
Ok