0

제 3 자 인증을 처음 접했고 simple-auth와 쌍을 이루는 ember-cli-simple-auth 애드온을 통해 LinkedIn에 대한 API 요청을 할 수 없었습니다 -auth2. 내 environment.js는 아래에 있습니다. Simple Labs의 introduction1과 http://ember-simple-auth.com/ember-simple-auth-api-docs.html1의 파트를 함께 모으려고 시도했습니다. 구체적으로 환경 '= 테스트'의 맨 아래에 있습니다. (경고하지 또는 오류)라고 나는 CLI 프로젝트를 구축 한 후 오류를 얻을하지 않습니다하지만 브라우저의 콘솔에서 알림을받을 수 있나요 :간단한 ember-cli-simple-auth 및 oauth2 프로젝트

No authorizer was configured for Ember Simple Auth - specify one if backend requests need to be authorized. 

을 지금을, 난 그냥 인증을 얻으려고 LinkedIn에서 토큰을 돌려 받고 다음 단계가 무엇인지 잘 모릅니다.

Uncaught Error: Assertion Failed: No authenticator for factory "authenticator:simple-auth-oauth2" could be found 

나는 어느 부분 또는 부품을 그리워 않은 : 내 로그인 컨트롤러합니다 (loginControllerMixin을 확장)에서 "인증"액션을 트리거하려고하면, 나는 콘솔에 오류가 말하는거야?


Environment.js은 : 당신이 authenticator:simple-auth-oauth2를 사용하는 동안

// config/environment.js 
/* jshint node: true */ 

module.exports = function(environment) { 
    var ENV = { 
    modulePrefix: 'seminars-me', 
    environment: environment, 
    baseURL: '/', 
    locationType: 'auto', 
    EmberENV: { 
     FEATURES: { 
     // Here you can enable experimental features on an ember canary build 
     // e.g. 'with-controller': true 
     } 
    }, 

APP: { 
    // Here you can pass flags/options to your application instance 
    // when it is created 
} 


}; 

    if (environment === 'development') { 
    // ENV.APP.LOG_RESOLVER = true; 
    // ENV.APP.LOG_ACTIVE_GENERATION = true; 
    // ENV.APP.LOG_TRANSITIONS = true; 
    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 
    // ENV.APP.LOG_VIEW_LOOKUPS = true; 
    } 

    if (environment === 'test') { 
    // Testem prefers this... 
    ENV.baseURL = '/'; 
    ENV.locationType = 'none'; 

// keep test console output quieter 
ENV.APP.LOG_ACTIVE_GENERATION = false; 
ENV.APP.LOG_VIEW_LOOKUPS = false; 

ENV.APP.rootElement = '#ember-testing'; 

ENV['simple-auth-oauth2'] = { 
    serverTokenEndpoint: 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=757ll7ci1xd93u&scope=profile' 
}; 
    ENV['simple-auth'] = { 
     authorizer: 'simple-auth-authorizer:oauth2-bearer', 
     crossOriginWhitelist: ['https://www.linkedin.com'], 
     store: 'simple-auth-session-store:local-storage' 
    }; 
    } 

    if (environment === 'production') { 

    } 

    return ENV; 
}; 
+0

'ember-cli-simple-auth'와'ember-cli-simple-auth-oauth2'를 모두 설치 했습니까? – marcoow

+0

@marcoow 그래, 그랬어 터미널은 어떤 오류도 출력하지 않았다. – mmwebster

답변

3

인증자는 실제로 simple-auth-authenticator:oauth2-password-grant로 등록됩니다.

+0

나는 LinkedIn API가 CORS와의 도메인 간 요청을 실제로 지원하지 않는다는 것을 알아 냈다. cli 기반 엠버 앱을 계속 사용하면서 LinkedIn API에 요청할 수있는 가장 좋은 방법은 무엇이라고 제안 하시겠습니까? – mmwebster

+0

문서 : https://developer.linkedin.com/documents/getting-started-javascript-api & https://developer.linkedin.com/documents/exchange-jsapi-tokens-rest-api-oauth-tokens – mmwebster