Slack commands for managing LTI provided apps
Uses the great LTI Provider library from Stephen Vickers (http://www.spvsoftwareproducts.com/java/lti_tool_provider/)
Displays help
/lti help
List installed consumers
/lti list
Add a new consumer
/lti add alias key secret launch_url description
To add tsugi-java-servlet (https://github.com/tsugiproject/tsugi-java-servlet) simply type
/lti add tsugi-java 12345 secret http://localhost:8080/tsugi-servlet/hello Tsugi Java Servlet
Launches a consumer
/lti launch alias
To launch tsugi-java-servlet (https://github.com/tsugiproject/tsugi-java-servlet) added as before
/lti launch tsugi-java
-
Create Database
CREATE DATABASE slackLti DEFAULT CHARACTER SET utf8; GRANT ALL ON slackLti.* TO 'slackLti'@'localhost' IDENTIFIED BY 'slackLti'; GRANT ALL ON slackLti.* TO 'slackLti'@'127.0.0.1' IDENTIFIED BY 'slackLti';
-
Download library from http://www.spvsoftwareproducts.com/java/lti_tool_provider/
-
Add to your maven repo. Assuming the library is in
/Users/xavi/Downloads/LtiToolProvider-1.1.01/LtiToolProvider-1.1.01.jar
:mvn install:install-file -Dfile=/Users/xavi/Downloads/LtiToolProvider-1.1.01/LtiToolProvider-1.1.01.jar \ -DgroupId=org.oscelot \ -DartifactId=lti-tool-provider \ -Dversion=1.1.01 \ -Dpackaging=jar
Define current profile in src/main/resources/application.properties
# Active Profile
spring.profiles.active=devel
Set database properties in src/main/resources/application-{active_profile}.yml
# Database configuration
spring.datasource:
url: jdbc:mysql://localhost/slackLti
username: slackLti
password: slackLti
driverClassName: com.mysql.jdbc.Driver
We use Slack Web API for getting user's info (that is because the launch url is user agnostic).
Set client properties in src/main/resources/application-{active_profile}.yml
:
security:
oauth2:
client:
clientId: <your client id>
clientSecret: <your client secret>
Visit https://api.slack.com/apps for registering an app and getting the client id and secret.