1
我開始創建谷歌應用程序市場應用程序時遇到了很多麻煩。混合演示不返回oauth請求令牌
我已經嘗試過大量的演示,包括可以從谷歌下載的php hello world示例。在任何情況下,openid部分都可以正常工作,但oauth失敗。
我已經跟蹤到混合openid/oauth請求不返回oauth請求令牌。你可以在這裏看到我的混合標準演示的版本http://lookmumimontheinternet.com/staging/hybrid/index.php
你可以看到我停止了重定向並在鏈接中輸出url進行調試。我還輸出了$ _REQUEST對象中返回的所有內容。
此鏈接到一個市場的應用與如下因素清單:
<?xml version="1.0" encoding="UTF-8" ?>
<ApplicationManifest xmlns="http://schemas.google.com/ApplicationManifest/2009">
<!-- Metadata -->
<Name>Hello World</Name>
<Description>A simple application for demonstrating the marketplace</Description>
<Support>
<Link rel="support" href="http://www.lookmumimontheinternet.com/staging/hybrid/support.php" />
</Support>
<!-- Navigation link -->
<Extension id="navlink" type="link">
<Name>Hello World</Name>
<Url>http://www.lookmumimontheinternet.com/staging/hybrid/index.php?from=google&domain=${DOMAIN_NAME}</Url>
<Scope ref="calendarFeed"/>
</Extension>
<!-- Single Sign On with OpenID -->
<Extension id="realm" type="openIdRealm">
<Url>http://lookmumimontheinternet.com/staging/hybrid</Url>
</Extension>
<!-- Authorized Data access -->
<Scope id="calendarFeed">
<Url>https://www.google.com/calendar/feeds/</Url>
<Reason>This app displays your next upcoming calendar appointment..</Reason>
</Scope>
</ApplicationManifest>
這裏是我的安裝演示(我知道我不應該張貼的祕密的PHP配置,但它只是一個測試應用程序):
$CONSUMER_KEY = '995079586589.apps.googleusercontent.com';
$CONSUMER_SECRET = '6yTp+2Xz7nSqB4Yx6OdSds7n';
$openid_params = array(
'openid.ns' => 'http://specs.openid.net/auth/2.0',
'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select',
'openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select',
'openid.return_to' => "http://lookmumimontheinternet.com/staging/hybrid/index.php",
'openid.realm' => "http://lookmumimontheinternet.com/staging/hybrid",
'openid.mode' => @$_REQUEST['openid_mode'],
'openid.ns.ui' => 'http://specs.openid.net/extensions/ui/1.0',
'openid.ns.ext1' => 'http://openid.net/srv/ax/1.0',
'openid.ext1.mode' => 'fetch_request',
'openid.ext1.type.email' => 'http://axschema.org/contact/email',
'openid.ext1.type.first' => 'http://axschema.org/namePerson/first',
'openid.ext1.type.last' => 'http://axschema.org/namePerson/last',
'openid.ext1.type.country' => 'http://axschema.org/contact/country/home',
'openid.ext1.type.lang' => 'http://axschema.org/pref/language',
'openid.ext1.required' => 'email,first,last,country,lang',
'openid.ns.oauth' => 'http://specs.openid.net/extensions/oauth/1.0',
'openid.oauth.consumer' => $CONSUMER_KEY,
'openid.oauth.scope' => implode(' ', $scopes)
);
$openid_ext = array(
'openid.ns.ext1' => 'http://openid.net/srv/ax/1.0',
'openid.ext1.mode' => 'fetch_request',
'openid.ext1.type.email' => 'http://axschema.org/contact/email',
'openid.ext1.type.first' => 'http://axschema.org/namePerson/first',
'openid.ext1.type.last' => 'http://axschema.org/namePerson/last',
'openid.ext1.type.country' => 'http://axschema.org/contact/country/home',
'openid.ext1.type.lang' => 'http://axschema.org/pref/language',
'openid.ext1.required' => 'email,first,last,country,lang',
'openid.ns.oauth' => 'http://specs.openid.net/extensions/oauth/1.0',
'openid.oauth.consumer' => $CONSUMER_KEY,
'openid.oauth.scope' => implode(' ', $scopes),
'openid.ui.icon' => 'true'
);
在運行,我可以看到,即使被要求它是一個正在返回任何OAuth令牌(正確就演示可以看到)。任何人都可以看到我在這裏做錯了嗎?