Coder Social home page Coder Social logo

n8zwn / pic-sure-auth-microapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hms-dbmi/pic-sure-auth-microapp

0.0 0.0 0.0 4.78 MB

microapp

License: Apache License 2.0

Shell 0.81% Java 96.82% HTML 0.09% PLpgSQL 0.79% Dockerfile 0.98% Mustache 0.52%

pic-sure-auth-microapp's Introduction

PIC-SURE Auth MicroApp

Local Development

At present, local development is conducted using our All-In-One Virtual Box. We offer implementations for both CentOS and Redhat based operating systems. To get started, please consult the README section of the All-In-One repository.

To add an initial top admin user in the system

If you follow the steps above, spins up the docker containers and you can see the login page in the browser, you are almost there.

You just need to add a top admin user in the system to be able to play with all features.

There is a sql script in source code for adding the top admin user with some initial setup, you can import the script into your database.

Open the file under /{{root_pic-sure-auth-microapp}}/pic-sure-auth-db/db/tools/first_time_run_the_system_and_insert_admin_user.sql, modify the configuration data - @user_email with your own google email

Terms of Service

If a user logging in has not accepted the latest terms of service, they will be directed to the 'Accept Terms of Service' page. The content of the terms of service is stored in the termsOfService table in the database. This is html that is rendered on the page.
To trigger the acceptance of the terms of service, this html must include a button with class 'accept-tos-button'. Anything with this class, upon clicking, will register the logged in user as accepting terms of service. This button can be disabled until criteria are met. Some example termsOfService content would be:

These are the terms of service.
<br>
<input type="checkbox" id="checkMe">This box must be checked</input>
<br>
<button type="button" disabled id="acceptBtn" class="btn btn-info accept-tos-button">
  <span>Accept</span> 
</button>
<script>
 $('#checkMe').on('change', function(){
	$('#acceptBtn').prop("disabled", !this.checked);
	});
</script>

Email templates configuration

PSAMA has mechanism of sending various emails to the users and admins depending of the action. MailService.class is responsible for compiling Mustache templates and populating it with required information based on parameters. There are few settings configured in standalone.xml for that.

Email Template Path is where email templates could be stored, so that it can be configured per stack if needed.

<simple name="java:global/templatePath" value="${env.TEMPLATE_PATH:/usr/local/shared/applications/}"/>

Email Template Path can be mapped as a volume in a container, so that application can discover it, where directory matching the one from standalone.xml:

volumes:
    - $PWD/config/psama/emailTemplates:/usr/local/shared/applications

Denied Email Enabled is flag to enable sending email to admin if user has not been added to system and trying to login.

<simple name="java:global/deniedEmailEnabled" value="${env.DENIED_EMAIL_ENABLED:true}"/>

List of admin email configured as below. Provide comma separated list of admin.

<simple name="java:global/adminUsers" value="${env.COMMA_SEPARATED_EMAILS}"/>

pic-sure-auth-microapp's People

Contributors

anilk2hms avatar calypsomatic avatar chunacatsunflower avatar dependabot[bot] avatar dmpillion avatar gcolon021 avatar gkorodi avatar hackerceo avatar jamespeck avatar kant avatar luke-sikina avatar namdets avatar nixj14 avatar ramari16 avatar rjyoung736 avatar yuavillachlab avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.