Oauth2 demo tutorial

    This tutorial guide you step-by-step through a basic setup of oauth2 authorization against simple demo server.

    Before you start

    For successful passing through this demo it would be necessary to check if the ports 8080 and 8081 are free to use, because as default the demo is set on following url's:

    In case those ports are busy, the default setup needs to be changed.

    Prerequisites for demo Oauth2 server

    Maven installation here. Once you have a working maven, you can download and unzip demo_server

    find the application.properties here ~\oauth2_server\src\main\resources\application.properties, where you can configure server and demo user. As default it is preconfigured as bellow:

    server.port=8081
    server.servlet.context-path=/
    user.oauth.clientId=e26c9934-6378-40f2-9c9a-dc0c21fa56ae
    user.oauth.clientSecret=Dud892hgjyhyEqXZTXESx1WySiIOvoNKZSJ05VX6
    user.oauth.redirectUris=http://localhost:8080/login
    user.oauth.user.username=user@chemaxon.com
    user.oauth.user.password=user
    user.oauth.user.roles=ROLE_USER,ROLE_ADMIN
    user.oauth.signingKey=-----BEGIN RSA PRIVATE KEY-----\
    MIICWgIBAAKBgEG59Yr5pD8msT6mP9LoouqAuRrOxy9ib3sKEBlAQz+SM4YpS9M/\
    XAOa/ovuujCrNwU5bpsI0HuNqdvu38UlXzYiilSwM19/xuUMKXMU2FSF4fpVzrBu\
    Zqp6PPRCs3rnlSUqD+U7kuYcJ0TdVK7nAkABTemnpHUiAOWAFMJ8kwgrAgMBAAEC\
    gYAmdnyK56yGiE4RK5kOA7XTJaEtXvSRdjlm92yUWlcATL56NJB6/wkJ0xpDKWEs\
    OgXouMNRVscqhqxwWEn7RPOCUsFMwP/YFo1SCAd0ymga9em35MnWhB9JAuxN0VUm\
    BgqxW8A02uTDJVU2Gj4I+NsbLG/LhJJ8hGZkHY8ojna9gQJBAIK0Wcsk5YZ7v0qL\
    4DkHGr7U+wrREEe5pNpzzflgxTNtv7rwC4Rd2pm7mYWUKJDbKuWWqFwVb82VrCQu\
    V+BUngUCQQCAu5qLsAEj3ubQt8LMrCFVYlhfziF/7A2ek1E8YWYrceSyZehF71FK\
    FMOyZdR339Hhb8CtuKplmCFNdc7pW7RvAkAGIvuYSxovrz2y/VBAvTGnRg6nWlt+\
    UpwH2aoRDFcV7BA1cbHIvDNYRnOVzvf8nR2te95ZvHPsXhuf80ES+kYVAkA3c5hA\
    r5HuJ6f5JA7PJx48r14t9pbLiZzcP8zwW2wtLqQ6jFcfONUlOgiKIf8Bm/HGT+MJ\
    cdBEbuF5glOchZoVAkA68n0/8SVxeMr5g0Bg1YGoCzfS4n1hnYGOjB6aXd9B/SdE\
    SBmfnA8qdIWrM4ueA/NAo0NOJwmdA5dueCfpcFUL\
    -----END RSA PRIVATE KEY-----

    Start your demo server from command line by mvn spring-boot:run command from the root directory of the server. Note that you will be able to compile server with Maven only by using Java JDK. In case of Java JRE it will fail.

    Now let's setup Plexus Connect

    There is an assumption, that basic Plexus Connect installation has been successfully done and you have deployed at least one schema with some security configuration coming from Instant JChem. Here you have to create config.properties which is necessary for configuration of pass to Connect. Conntent of the file:

    authentication.type=pass
    pass.uri=http://localhost:8081/
    pass.clientId=e26c9934-6378-40f2-9c9a-dc0c21fa56ae
    pass.clientSecret=Dud892hgjyhyEqXZTXESx1WySiIOvoNKZSJ05VX6
    pass.publicKey=-----BEGIN PUBLIC KEY----- \
    MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgEG59Yr5pD8msT6mP9LoouqAuRrO\
    xy9ib3sKEBlAQz+SM4YpS9M/XAOa/ovuujCrNwU5bpsI0HuNqdvu38UlXzYiilSw\
    M19/xuUMKXMU2FSF4fpVzrBuZqp6PPRCs3rnlSUqD+U7kuYcJ0TdVK7nAkABTemn\
    pHUiAOWAFMJ8kwgrAgMBAAE=\
    -----END PUBLIC KEY-----

    This configuration file needs to be save somewhere on the server, where Connect application is installed. We recommend to save it in configuration directory ~/.chemaxon/plexus-suite/config.properties

    Use following startup option with correct path to this properties file and restart server. -Dcom.chemaxon.plexus.connect.configuration.propertiesFilePath=~/.chemaxon/plexus-suite/config.properties

    If everything above passed without any problem, you should be able to login into Plexus Connect with relevant user. This short demo example is not for a real usage, it is intended only to clarify, how that given implementation should be used.