rest-api icon indicating copy to clipboard operation
rest-api copied to clipboard

Authentication as LuckPerms extension

Open Timtendo12 opened this issue 3 years ago • 4 comments

Hi!

I can't seem to be able to get the authentication working. I tried adding this to the startup command:

java -DLUCKPERMS_REST_AUTH=true -DLUCKPERMS_REST_AUTH_KEYS=<authkey> ..(rest of my startup command line)

I even have them setup as a env variable using the "export" command on my linux server but I keep getting the error:

{
    "error": "You are not authorized to access this endpoint."
}

Timtendo12 avatar Jan 14 '23 16:01 Timtendo12

Try:

java -Dluckperms.rest.auth=true -Dluckperms.rest.auth.keys=<authkey> ..(rest of my startup command line)

and then make HTTP requests with the following header

Authorization: Bearer <authkey>

If that doesn't work, please give more detailed reproduction steps and I can have a deeper look. :)

lucko avatar Jan 29 '23 23:01 lucko

Hmm, It still does not seem to be able to authenticate:

How to reproduce:

Running as a LuckPerms extension on Velocity

My full startup command:

java -Dluckperms.rest.auth=true -Dluckperms.rest.auth.keys=Q8LZlntXcPwS2nhnbgqqFRafH0zVna12 -Xms128M -Xmx{{SERVER_MEMORY}}M -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:MaxInlineLevel=15 -jar {{SERVER_JARFILE}}

Luckperms startup log: https://hastebin.com/share/ipunabuqic.markdown

Postman settings: image

Timtendo12 avatar Feb 01 '23 14:02 Timtendo12

That error does not look like it's coming from LuckPerms

lucko avatar Feb 01 '23 18:02 lucko

Hmm weird, I'll continue troubleshooting... However, if I don't get it to work you think I could hardcode the credentials into the jar?

Timtendo12 avatar Feb 02 '23 11:02 Timtendo12