GithubHelp home page GithubHelp logo

isabella232 / stargate-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from forcedotcom/stargate

0.0 0.0 0.0 49 KB

Play Scala Module for Integrating with Salesforce Marketing Cloud Single Sign On

License: BSD 3-Clause "New" or "Revised" License

Scala 96.66% CSS 0.20% HTML 3.14%

stargate-1's Introduction

Stargate

Maven Central CircleCI

"It was a small outpost: a nexus, assimilator, and a couple of gateways." โ€” Flight Sergeant Aaron Keebler. The stargate is an advanced protoss structure.

Stargate is a Play Scala Module that adds API endpoints to your app to enable integration with Salesforce Marketing Cloud Single Sign On. Redis is required to persist the session.

How to Add Stargate to Your Play Scala App

Add dependency to build.sbt.

libraryDependencies += "com.salesforce.mce" %% "stargate-redis" % "_VERSION_"

Add default Stargate configuration in application.conf. Make sure to set STARGATE_MC_SECRET_KEY and PLAY_SECRET.

include "stargate.default.conf"
# (optional) overwrite any of the Stargate configs below

Include stargate's routes in routes file. You may specify a different sub URL path other than /stargate.

->  /stargate stargate.Routes

Run Play app server.

$ STARGATE_IS_DEV_LOGIN_ENABLED=true sbt ~run

Post Successful Login Callback

If your app needs to run arbitrary code right after successful login, you may create a subclass of McSsoController and override postLoginCallback method (see McSsoControllerSpec for example).

In routes file, above stargate.Routes, declare the login route to point to your subclass.

POST    /stargate/sso/mc/login       controllers.stargate.YourAppCustomMcSsoController.login
->      /stargate                    stargate.Routes

Development Setup

Clone repository.

$ git clone [email protected]:forcedotcom/stargate.git

Change directory.

$ cd stargate

Set up redis cluster with docker.

$ docker run  -e "IP=0.0.0.0" -p7000:7000 -p7001:7001 -p7002:7002 --hostname redis-cluster  grokzen/redis-cluster:latest

Run Play app server in the redis module.

$ sbt ~redis/run

Visit http://localhost:9000/sso/mc/dev-login to view mock login page.

Run automated tests.

$ sbt test

Credits

Special thanks to the following authors (in alphabetical order) for their commits in the original repository before Stargate became open source.

  • Andrew Hoblitzell
  • Byju Sukumaran
  • Calvin Henry
  • Kexin Xie
  • Patrick Frampton
  • Sheng-Loong Su
  • Trent Albright

stargate-1's People

Contributors

sushengloong avatar talbright avatar shwetank87 avatar jeffzickgraf avatar jkbudd avatar realstraw avatar wandliu avatar bsukumaran avatar svc-scm 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.