restheart

Rest heart without authentication


I'm using Rest Heart and I want to:

1) Disable authentication of Rest Heart. I don't want to provide any credential like admin:changeit when doing crud operations. 2) Disable authentication of Rest Heart with Mongo because my Mongo doesn't have authentication enabled (and I don't want to enable it)

I think that that can be done editing yml file, but its not clear to me even reading the documentation.

Thanks in Advance.


Solution

  • To disable security in RESTHeart you just comment out the following lines in restheart.yml configuration file

    #idm:
    #  implementation-class: org.restheart.security.impl.SimpleFileIdentityManager
    #  conf-file: {{{idm.conf-file}}}
    
    #access-manager:
    #  implementation-class: org.restheart.security.impl.SimpleAccessManager
    #  conf-file: {{{access-manager.conf-file}}}
    

    The credentials of MongoDb are specified in the mongo-uri, for instance:

    mongo-uri: mongodb://user:secret@127.0.0.1/?authSource=authdb
    

    If you want to run MongoDb without security just set the following:

    mongo-uri: mongodb://127.0.0.1/