ember-simple-auth

ember-cli torii and multiple providers

给你一囗甜甜゛ 提交于 2020-01-17 04:42:32
问题 I am trying to set up an authenticator which would be valid for many providers, because in the backend I am using doorkeeper assertion method which handles the whole flow. I have installed: * "ember-cli-simple-auth": "0.8.0-beta.1" * "ember-cli-simple-auth-oauth2": "^0.8.0-beta.2" * "ember-cli-simple-auth-torii": "^0.8.0-beta.2" * "torii": "^0.3.4" I was looking at this issue Workflow for Ember-simple-auth, Torii and Facebook Oauth2 so I could write this: # templates/login <a {{action

ember-cli torii and multiple providers

大憨熊 提交于 2020-01-17 04:42:06
问题 I am trying to set up an authenticator which would be valid for many providers, because in the backend I am using doorkeeper assertion method which handles the whole flow. I have installed: * "ember-cli-simple-auth": "0.8.0-beta.1" * "ember-cli-simple-auth-oauth2": "^0.8.0-beta.2" * "ember-cli-simple-auth-torii": "^0.8.0-beta.2" * "torii": "^0.3.4" I was looking at this issue Workflow for Ember-simple-auth, Torii and Facebook Oauth2 so I could write this: # templates/login <a {{action

Ember.js - How can I save data to session from authenticator?

余生长醉 提交于 2020-01-16 22:00:23
问题 I have tried doing this.get('session') but it gives me nothing. I want to save data to my session I only seem to get the information I need from the authenticator but can't seem to be able to pass it around. (Tried a couple of methods suggested on SO but none seem to be able to work from the autheticator) import Ember from 'ember'; import Torii from 'ember-simple-auth/authenticators/torii'; const { service } = Ember.inject; export default Torii.extend({ torii: service('torii'), authenticate

Ember-Simple-Auth with Torii access user info

只愿长相守 提交于 2020-01-14 03:46:07
问题 I've been working all week to get authentication working. I have gotten it working with Ember-CLI Ember-Simple-Auth Torii google-oauth2 provider However I have proven unsuccessful in getting the users information from google. I have tried creating a torii-adapter as stated in their documentation but it doesn't appear to be called // app/torii-adapters/application.js export default Ember.Object.extend({ open: function(authorization){ console.log('authorization from adapter', authorization); }

How to use a custom authorizer and custom authenticator for ember simple-auth in ember cli

南笙酒味 提交于 2020-01-12 05:39:51
问题 I don't understand how I'm supposed to include my custom authenticator and custom authorizor with ember cli. Where to put it and what to include and how to do it. The cli example for simple-auth provided unfortunately does not cover custom authorizer and authenticator. The build is successfully, but when running it in the browser, I get the error TypeError: SimpleAuth.Authenticators is undefined I'm aware that I'm doing something wrong, but could you please guide me or point me to the right

Invalidate session with custom authenticator

爱⌒轻易说出口 提交于 2020-01-06 13:52:06
问题 Using ember-cli 0.1.2 and ember-cli-simple-auth 0.7.0, I need to invalidate the session both on client and server. As explained here I need to do something similar to the authenticate method making an ajax request to the server and ensuring its success before emptying the session: import Ember from 'ember'; import Base from "simple-auth/authenticators/base"; var CustomAuthenticator = Base.extend({ tokenEndpoint: 'http://127.0.0.1:3000/api/v1/auth/login', restore: function(data) { },

Invalidate session with custom authenticator

喜夏-厌秋 提交于 2020-01-06 13:51:10
问题 Using ember-cli 0.1.2 and ember-cli-simple-auth 0.7.0, I need to invalidate the session both on client and server. As explained here I need to do something similar to the authenticate method making an ajax request to the server and ensuring its success before emptying the session: import Ember from 'ember'; import Base from "simple-auth/authenticators/base"; var CustomAuthenticator = Base.extend({ tokenEndpoint: 'http://127.0.0.1:3000/api/v1/auth/login', restore: function(data) { },

How to expires the ember-simple-auth session?

做~自己de王妃 提交于 2020-01-04 13:45:44
问题 I am using ember-simple-auth for authentication in my application. I have created my custom Authenticator. Upon successful authentication, the server returns the token and expire time which I store in session storage of simple-auth. My question is how do I expires or invalidate this session based on the expire time set in the session? I also need to invalidate the session on browser close event. Thanks. 回答1: You can simply call the session's invalidate method. To call that after the

Ember Simple Auth custom authenticator

我只是一个虾纸丫 提交于 2019-12-30 10:29:08
问题 I've been trying to create a session.currentUser property with an id , email , and points properties. I'm referencing Custom authenticator with Ember simple auth + Ember CLI and How to store the user in a session, but I just can't figure out how the pieces fit together. I'm using Ember CLI. In my index.html , I have: window.ENV['simple-auth'] = { authorizer: 'simple-auth-authorizer:devise', session: 'session:custom' }; In initializers/custom-session.js , I have: import Session from 'simple

How to store the user in a session

若如初见. 提交于 2019-12-30 06:45:47
问题 I am trying to set up ember-simple-auth with a django-rest-framework backend, but I'm running into some trouble saving the user to the session. I have to be able to do something like this in my templates: <h2>Welcome back, {{session.user}}</h2> So following several guides I found, I have got the authentication and authorization working so that I can get a valid token and use is in requests. To get the user on the session, I have modified App.CustomAuthenticator.authenticate so that when the