gitkit ウィジェットを実行すると、次のエラーが表示されます。
[ 0.004s] [identitytoolkit] Invalid config: "callbackUrl"rj @ gitkit.js:236pj.addLogRecord @ gitkit.js:236Li.log @ gitkit.js:219Q @ gitkit.js:236zl @ gitkit.js:273(anonymous function) @ gitkit.js:306(anonymous function) @ gitkit-widget.html?mode=select:29
私のコードは次のとおりです。
var config = {
signInSuccessUrl: "/",
apiKey: "AIzaSyAt3gELMqBCdn9U8FLSXbtCJbizHSX3kng",
siteName: "Google Apps Training",
signInOptions: ["google","facebook", "microsoft"],
//idps: ["google", "facebook", "microsoft"],
/*callbacks: {
signInSuccess: function(tokenString, accountInfo, signInSuccessUrl) {
console.log("callback");
console.log(tokenString);
console.log(accountInfo);
console.log(signInSuccessUrl);
return true;
}
},*/
callbackUrl: "http://localhost:8080/signin"
};
// The HTTP POST body should be escaped by the server to prevent XSS
window.google.identitytoolkit.start(
'#gitkitWidgetDiv', // accepts any CSS selector
config);
https://developers.google.com/identity/toolkit/web/setup-frontendで入手できる gitkit ドキュメント サンプルを次に示します。
var config = {
apiKey: 'AIza...',
signInSuccessUrl: '/',
signInOptions: ["google", "password"],
oobActionUrl: '/',
siteName: 'this site',
// Optional - function called after sign in completes and before
// redirecting to signInSuccessUrl. Return false to disable
// redirect.
// callbacks: {
// signInSuccess: function(tokenString, accountInfo,
// opt_signInSuccessUrl) {
// return true;
// }
// },
// Optional - key for query parameter that overrides
// signInSuccessUrl value (default: 'signInSuccessUrl')
// queryParameterForSignInSuccessUrl: 'url'
// Optional - URL of site ToS (linked and req. consent for signup)
// tosUrl: 'http://example.com/terms_of_service',
// Optional - URL of callback page (default: current url)
// callbackUrl: 'http://example.com/callback',
// Optional - Cookie name (default: gtoken)
// NOTE: Also needs to be added to config of the ‘page with
// sign in button’. See above
// cookieName: ‘example_cookie’,
// Optional - UI configuration for accountchooser.com
/*acUiConfig: {
title: 'Sign in to example.com',
favicon: 'http://example.com/favicon.ico',
branding: 'http://example.com/account_choooser_branding'
},
*/
// Optional - Function to send ajax POST requests to your Recover URL
// Intended for CSRF protection, see Advanced Topics
// url - URL to send the POST request to
// data - Raw data to include as the body of the request
//completed - Function to call with the object that you parse from
// the JSON response text. {} if no response
/*ajaxSender: function(url, data, completed) {
},
*/
};
// The HTTP POST body should be escaped by the server to prevent XSS
window.google.identitytoolkit.start(
'#gitkitWidgetDiv', // accepts any CSS selector
config,
'JAVASCRIPT_ESCAPED_POST_BODY');
では、最新のサンプル コードで使用可能なオプション パラメータとして「callbackUrl」が示されている場合、なぜ gitkit js はそれが有効であると認識しないのでしょうか?
利用可能なすべてのパラメータを確認できる場所はありますか?
よろしく。