2.10.7 • Published 8 days ago

hx-with-sso-hoc v2.10.7

Weekly downloads
4
License
ISC
Repository
github
Last release
8 days ago

hx-with-sso-hoc

The withSSO hoc can be used to wrap any Helixa react application that needs SSO auth. the HOC handles all the redirects and tokens needed in order to auth the hosting application.

See React HOC

A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per se. They are a pattern that emerges from React’s compositional nature.


Usage

Install the package

npm i hx-with-sso-hoc --save

Then import the HOC

import withSSO from 'hx-with-sso-hoc'

Then the current app needs to be wrapped with needed parameters.

Es:

class App extends React.Component {
  render() {
    const { logged, singleSignOff } = this.props;
    return(
        <div>{logged}</div>
   )
  }
}

export default withSSO({
  appID: process.env.REACT_APP_APP_ID,
  idServerBase: process.env.REACT_APP_ID_SERVER_BASE,
  idServerBaseSignIn: process.env.REACT_APP_ID_SERVER_AUTH,
  idTokenKey: 'HELIXA_ID_TOKEN',
  accessTokenKey: 'HELIXA_ACCESS_TOKEN',
})(App);

Config example of the envs:

REACT_APP_ID_SERVER_BASE=//accounts.helixa.ai
REACT_APP_ID_SERVER_AUTH=//accounts.helixa.ai/login
REACT_APP_APP_ID=hx-engine-ui
2.10.7

8 days ago

2.10.6

4 months ago

2.10.5

6 months ago

2.10.3

7 months ago

2.10.4

7 months ago

2.10.2

11 months ago

2.10.1

2 years ago

2.10.0

2 years ago

2.9.1

2 years ago

2.9.0

2 years ago

2.8.0

4 years ago

2.7.0

4 years ago

2.6.0

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago