How to use the ember-simple-auth/authenticators/oauth2-password-grant.extend function in ember-simple-auth

To help you get started, we’ve selected a few ember-simple-auth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CodingItWrong / firehose-api / frontend / app / authenticators / oauth.js View on Github external
// eslint-disable-next-line max-len
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import ENV from '../config/environment';

const serverTokenPath = '/api/oauth/token';
const serverTokenEndpoint = ENV.apiHost
  ? ENV.apiHost + serverTokenPath
  : serverTokenPath;

export default OAuth2PasswordGrant.extend({
  serverTokenEndpoint,
});
github TryGhost / Ghost-Admin / app / authenticators / oauth2.js View on Github external
import Authenticator from 'ember-simple-auth/authenticators/oauth2-password-grant';
import RSVP from 'rsvp';
import {assign} from '@ember/polyfills';
import {computed} from '@ember/object';
import {isEmpty} from '@ember/utils';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {makeArray as wrap} from '@ember/array';

export default Authenticator.extend({
    ajax: service(),
    session: service(),
    config: service(),
    ghostPaths: service(),

    init() {
        this._super(...arguments);

        let handler = run.bind(this, () => {
            this.onOnline();
        });
        window.addEventListener('online', handler);
    },

    serverTokenEndpoint: computed('ghostPaths.apiRoot', function () {
        return `${this.get('ghostPaths.apiRoot')}/authentication/token`;
github hummingbird-me / hummingbird-client / app / authenticators / oauth2.js View on Github external
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import { set } from '@ember/object';
import { inject as service } from '@ember/service';
import config from 'client/config/environment';

export default OAuth2PasswordGrant.extend({
  refreshAccessTokens: true,
  session: service(),

  init() {
    this._super(...arguments);
    const host = config.kitsu.APIHost || '';
    set(this, 'serverTokenEndpoint', `${host}/api/oauth/token`);
    set(this, 'serverTokenRevocationEndpoint', `${host}/api/oauth/revoke`);
  }
});
github kuzzmi / ember-express-blog / client / app / authenticators / oauth2.js View on Github external
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import config from '../config/environment';

export default OAuth2PasswordGrant.extend({
    serverTokenEndpoint: [config.API.host, config.API.namespace, 'auth/local'].join('/')
});
github Nanocloud / community / webapp / app / authenticators / oauth2.js View on Github external
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';

export default OAuth2PasswordGrant.extend({
  serverTokenEndpoint: 'oauth/token',
  serverTokenRevocationEndpoint: 'oauth/revoke',

  clientId: '9405fb6b0e59d2997e3c777a22d8f0e617a9f5b36b6565c7579e5be6deb8f7ae'
});
github muffin / server / app / authenticators / oauth2.js View on Github external
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';

export default OAuth2PasswordGrant.extend({
  serverTokenEndpoint: '/muffin/token'
});
github 7cart / 7cart / front / app / authenticators / oauth2.js View on Github external
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import config from 'front/config/environment';

export default OAuth2PasswordGrant.extend({
  serverTokenEndpoint: config.APP.backendHost+'/oauth/v2/token',
  clientId: config.APP.oAuth2Client,
  sendClientIdAsQueryParam: true,
  refreshAccessTokens: true,
  makeRequest(url, data, headers = {}) {
    data.client_secret = config.APP.oAuth2Secret;
    return this._super(url, data, headers);
  }
});