コード例 #1
0
func (this *testIdProvider) info() idpdb.Element {
	return idpdb.New(
		this.base.URL,
		nil,
		this.base.URL+"/auth",
		this.base.URL+"/token",
		this.base.URL+"/userinfo",
		this.base.URL+"/coop/from",
		this.base.URL+"/coop/to",
		this.keys,
	)
}
コード例 #2
0
ファイル: values_test.go プロジェクト: realglobe-Inc/edo-auth
	test_idpKey, _ = jwk.FromMap(map[string]interface{}{
		"kty": "EC",
		"crv": "P-256",
		"x":   "lpHYO1qpjU95B2sThPR2-1jv44axgaEDkQtcKNE-oZs",
		"y":   "soy5O11SFFFeYdhQVodXlYPIpeo0pCS69IxiVPPf0Tk",
		"d":   "3BhkCluOkm8d8gvaPD5FDG2zeEw2JKf3D5LwN-mYmsw",
	})
	test_taKey, _ = jwk.FromMap(map[string]interface{}{
		"kty": "EC",
		"crv": "P-384",
		"x":   "HlrMhzZww_AkmHV-2gDR5n7t75673UClnC7V2GewWva_sg-4GSUguFalVgwnK0tQ",
		"y":   "fxS48Fy50SZFZ-RAQRWUZXZgRSWwiKVkqPTd6gypfpQNkXSwE69BXYIAQcfaLcf2",
		"d":   "Gp-7eC0G7PjGzKoiAmTQ1iLsLU3AEy3h-bKFWSZOanXqSWI6wqJVPEUsatNYBJoG",
	})
	test_idp = idpdb.New(
		"https://idp.example.org", nil,
		"https://idp.example.org/auth", "", "", "", "", nil,
	)
)

func newAuthRequest() (*http.Request, error) {
	r, err := http.NewRequest("GET", "http://localhost/", nil)
	if err != nil {
		return nil, erro.Wrap(err)
	}
	r.Header.Set("X-Auth-Uri", test_idp.AuthUri())
	return r, nil
}

func newCallbackRequest(page *Page) (*http.Request, error) {
	q := url.Values{}
	q.Set("code", test_cod)