auth0を使用して私のangular2アプリケーションのログインを作成しようとしています。auth0-jsにエラーが見つかりませんAngular2
私は下のリンクを以下のい: - :
- を設定するコールバックURLを
- を - -
https://auth0.com/docs/quickstart/spa/angular2
を私は、次の手順にしました-save auth0-js
- Auth0のCDNからauth0.jsを取得します。
サービスの下に追加されました: -
// src/app/auth/auth.service.ts
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import 'rxjs/add/operator/filter';
import * as Auth0 from 'auth0-js';
//const Auth0 = require('auth0-js');
//import * as auth0 from './../../../node_modules/auth0-js/build/auth0.js';
@Injectable()
export class AuthService {
auth0 = new Auth0.WebAuth({
clientID: 'test',
domain: 'www.test.com',
responseType: 'token id_token',
audience: 'personaluserinfo',
redirectUri: 'http://localhost:3000/home',
scope: 'openid'
});
constructor(public router: Router) {}
public login(): void {
this.auth0.authorize();
}
}
しかし、以下のように、私はエラーを取得しています: -
zone.js:http://localhost:3000/auth0-js 404(2933見つかりませんGET )
家:23エラー:(SystemJS)XHRエラー(404が見つかりません)ロードhttp://localhost:3000/auth0-js
以下、これらのページへの答えは私にはそれほど有用ではありませんでした: -
How configure SystemJS with Auth0?
Angular 2 + Auth0 (Could not find a declaration file for module 'auth0-js'.)
どんな助けもありがとう。