Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add support for electrode-sso #1731

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

divyakarippath
Copy link
Contributor

Usage:

For selected routes:

"/": {
    pageTitle: "Welcome to Electrode",
    subApps: ["./home", "./demo1", "./demo2"],
    auth: ["electrode-sso"], // auth strategies decorated in fastify instance
    }
  },

To add SSO for all the routes, set auth as plugin option.

plugins: {
  "subapp-server": {
      enable: true,
      options: {
        auth: ["electrode-sso"]
      }
    },
}

Send To Client By Cookies:

"/": {
    pageTitle: "Welcome to Electrode",
    subApps: ["./home", "./demo1", "./demo2"],
    auth: ["electrode-sso"], // auth strategies decorated in fastify instance
    settings: {
      preHandler: (request, reply, done) => {
        if (request.auth && request.auth.credentials) {
          electrodeCookies.set("SSO_CRED", request.auth.credentials, { request, secure: true });
        }
        done();
      },
    }
  },

@jchip jchip merged commit 771273f into electrode-io:master Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants