Package Exports
- @ovh-ux/ng-ovh-sso-auth
- @ovh-ux/ng-ovh-sso-auth/dist/cjs/index.js
- @ovh-ux/ng-ovh-sso-auth/dist/esm/index.js
- @ovh-ux/ng-ovh-sso-auth/dist/umd/ng-ovh-sso-auth.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ovh-ux/ng-ovh-sso-auth) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ng-ovh-sso-auth
OVH $http interceptor working with SSO. Can be used with $resource!
Install
$ yarn add @ovh-ux/ng-ovh-sso-auth
Usage
import angular from 'angular';
import ngOvhSsoAuth from '@ovh-ux/ng-ovh-sso-auth';
angular
.module('myApp', [ngOvhSsoAuth])
.config(
/* @ngInject */ ($httpProvider, constants, ssoAuthenticationProvider) => {
ssoAuthenticationProvider.setLoginUrl(
constants.prodMode ? constants.loginUrl : 'auth.html',
);
ssoAuthenticationProvider.setLogoutUrl(
constants.prodMode
? '/engine/api/auth/logout'
: 'api/proxypass/auth/logout',
);
ssoAuthenticationProvider.setUserUrl(
constants.prodMode ? '/engine/api/me' : 'api/user',
);
const configuration = [
{
serviceType: 'api',
urlPrefix: 'api',
},
{
serviceType: 'aapi',
urlPrefix: constants.prodMode ? '../2api-m' : '2api-m',
},
{
serviceType: 'apiv6',
urlPrefix: 'apiv6',
},
];
ssoAuthenticationProvider.setConfig(configuration);
$httpProvider.interceptors.push('OvhSsoAuthInterceptor');
},
)
.run(
/* @ngInject */ (ssoAuthentication) => {
ssoAuthentication.login().then(() => {
// Do what you want after login.
});
},
);
Test
$ yarn test
Related
- @ovh-ux/ng-ovh-sso-auth-modal-plugin - OVH SSO module - Modal plugin
Contributing
Always feel free to help out! Whether it's filing bugs and feature requests or working on some of the open issues, our contributing guide will help get you started.
License
BSD-3-Clause © OVH SAS