• Resolved Kurt Junker

    (@kjunker)


    Hi Nicu,

    is it possible to update your great plugin, so that it is possible to send the JWT via cookie or authorization header (Bearer Token).

    If it is possible to create an Pull Request anywhere I will push my changes which I have done.

    I have updated the Login Setting and added a new form-group where the admin can choose from where the JWT should be read out.

    The process to read out the jwt was also updated.

    Kind regards,

    Kurt

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Kurt Junker

    (@kjunker)

    Hi Nicu,

    I have seen that you have implemented the authorization via Header in Version 1.5.
    Thanks a lot for this.

    Is it also possible that you can implement the authorization via cookie?
    Let’s say the cookie must have the name sjl-jwt then the plugin can search for this cookie with $_COOKIE[SIMPLE_JWT_LOGIN_COOKIE_NAME] and if that is not found then try bearer and then the request parameter.

    What do you think?!

    If you have implemented a wordpress Site with login in your own site in an iframe, it is not possible to change the Header. So the cookie is a secure way to store the jwt locally at client site.
    Regards,

    Kurt

    • This reply was modified 4 years, 9 months ago by Kurt Junker. Reason: additional info
    Plugin Author Nicu Micle

    (@nicu_m)

    Hello Kurt,

    This is a very good idea. Thank you.

    I am working now on a feature, that allows users to set the reading order of the JWT.
    I will add the $_COOKIE feature when this will be released.

    I hope that by the end of the week this feature will be live.

    Thank you for using Simple-JWT-Login.

    Plugin Author Nicu Micle

    (@nicu_m)

    Hello Kurt,

    I’m happy to announce that I’ve implemented your request.

    Now, you can get the JWT from URL, Header, Cookie and Session.

    Please upgrade the plugin to version 1.6.1.
    I’ve also updated the documentation, so you can check there how the feature is working.

    Also, please don’t forget to rate this plugin and spread the word about it.

    Have a nice day.

    • This reply was modified 4 years, 9 months ago by Nicu Micle.

    Hi @nicu_m sorry to bother you on an older thread again, but I can’t find any documentation about how the cookie option should be used. Can you please give a document link?

    Is that how I should set it? How does the plugin search for it?

    add_action( 'init', 'my_setcookie' );
    function my_setcookie() {
    setcookie( 'simple-jwt-login-token', 'JWT-TOKEN', time() + 3600);
    }
    • This reply was modified 4 years, 5 months ago by igurman.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Allow JWT as Cookie or Bearer’ is closed to new replies.