-
Notifications
You must be signed in to change notification settings - Fork 2
Authentication
restaf-server can be used in the following modes:
-
As a web server for static assets with no authentication
-
With authentication
- Implicit flow authentication
- Coming soon: authorization_code authentication
The env and Dockerfile for this scenario is in /env/static directory.
Examples of the env and Dockerfile for this scenario are here
env file: https://github.com/sassoftware/restaf-server/blob/master/env/static/app.env
docker file: https://github.com/sassoftware/restaf-server/blob/master/env/static/Dockerfile
The key values are the EXPOSE for port number and the APPENTRY.
Starting with this release always set your clientid callback as follows:
http://yourip:yourport/callback
ex:
http://localhost:8080/callback
restaf-server will handle the callback and redirect to APPENTRY.
The previous behavior will still work - so no need to change immediately.
To use this scenario modify these files as follows:
This is primarily used to override the values set in Dockerfile. Setting CLIENTID here is a good practice. A typical env file is shown below
VIYA_SERVER
CLIENTID=callback
APPENTRY=index.html
APPPORT=5000
- VIYA_SERVER: The Viya Server(http://...) can be set here or thru environment variables
- APPENTRY: On successful authentication the user will be redirected to the entry specified by APPENTRY.
- APPPORT: If not set here it will default to the value set by EXPOSE in the docker file. This should be sufficient for testing. When running in docker do not set this value. Instead use the -p myport:8080 on your run command
This is your standard Dockerfile
- Set the EXPOSE port to your desired port no. Set to 8080 when running in a docker container.
- Set the following to suit your needs
ENV APPHOST=<see note below>
ENV APPNAME=<see note below>
ENV APPLOC= typically ./public but it is where your assets are>
ENV APPENTRY=index.html or whatever your main entry is
Assign a meaningful name for your app.
This can be one of the following values:
localhost|*|ipAddress|dns-name-of-server
If set to *, restaf-server will resolve it to the dns name using nodejs function os.hostname.
This is the directory where restaf can find the static assets of your app. This is relative to the root of your application. Typically this is ./public
After a successful logon restaf will redirect to this entry specified via APPLOC.