2016-07-29 11 views
0

OpenID Connectの暗黙のフローを処理するコンポーネントを開発しています。コンポーネント内の特定の機能を持つリクエストを処理する

step 5 of the flowで、「認可サーバー」はIDトークンを使用してクライアントにエンド・ユーザーを戻し、要求された場合はアクセス・トークンを戻します。私たちは、その要求を処理するコンポーネントを~/openid-loginにします。

私たちはコンポーネントの機能にAureliaをルーティングするように設定しますか?

export class OpenId { 

    // how do we route ~/openid-login to this? 
    public handleRequest() { 

    } 

} 

注:お使いのrouteConfig内navStrategyを使用してHere is the work in progress.

答えて

2

は、ページに移動する前に、あなたが好きな今までに何をすることができます。以下を参照してください:

import { autoinject } from 'aurelia-framework'; 
import { RouterConfiguration, Router, NavigationInstruction } from 'aurelia-router'; 

@autoinject 
export class App { 

    router: Router; 

    configureRouter(config: RouterConfiguration, router: Router) { 

     let openIdNavStrat = (instruction: NavigationInstruction) => { 

      console.log('Do whatever we would like to do.'); 

      // then redirect to where ever you would like. 
      instruction.config.moduleId = 'login'; 
     } 

     config.map([ 
      { route: ['', 'login'], moduleId: 'login' }, 
      { route: 'openid-login', navigationStrategy: openIdNavStrat }, 
     ]); 

     this.router = router; 
    } 
} 

ナビゲーション戦略上のドキュメントはここにあります:http://aurelia.io/hub.html#/doc/article/aurelia/router/latest/router-configuration/3

+0

が、これはまた、我々はそれにルータ・ビューを持っているapp.htmlビューを持っている必要がありますか? –

関連する問題