点击Google Apps帐户中Google通用导航栏的“更多”部分中的navLink后,我不会直接登录我的应用程序,而是会显示我的应用程序的登录页面。
我的应用程序市场清单:
<ApplicationManifest xmlns="http://schemas.google.com/ApplicationManifest/2009">
<Name>App Name</Name>
<Description>App Description</Description>
<!-- Administrators and users will be sent to this URL for application support -->
<Support>
<Link rel="support" href="http://myappid.appspot.com/help.html" />
</Support>
<!-- Show this link in Google's universal navigation for all users -->
<Extension id="navLink" type="link">
<Name>Myapp Navlink Name</Name>
<Url>http://myappid.appspot.com/ms.jsp?hd=${DOMAIN_NAME}</Url>
</Extension>
<!-- Declare our OpenID realm so our app is white listed -->
<Extension id="realm" type="openIdRealm">
<Url>http://myappid.appspot.com/</Url>
</Extension>
</ApplicationManifest>
我的web.xml相关部分:
<servlet>
<servlet-name>loginJsp</servlet-name>
<jsp-file>/login.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>loginJsp</servlet-name>
<url-pattern>/_ah/login_required</url-pattern>
</servlet-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>ms</web-resource-name>
<url-pattern>/ms.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
答案 0 :(得分:0)
您需要创建一个servlet来处理http://myappid.appspot.com/ms.jsp?hd=${DOMAIN_NAME}
。它将获取域名并使用域federatedIdentity
重定向到登录URL。见:
使用正确的federatedIdentity
设置,用户将自动从Google Apps登录。
答案 1 :(得分:0)
另外。您应该将它添加到application-manifest.xml:
<Edition id="free">
<Name>Myapp Navlink Name</Name>
<Extension ref="navLink" />
<Extension ref="realm" />
</Edition>