• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

moto web application


コミットメタ情報

リビジョンe5039c95fa634af9a3230543b8368f16de196565 (tree)
日時2014-02-07 18:26:09
作者astoria-d <astoria-d@mail...>
コミッターastoria-d

ログメッセージ

google account supported.

変更サマリ

差分

--- a/WEB-INF/classes/motoSample/OpenIdBean.java
+++ b/WEB-INF/classes/motoSample/OpenIdBean.java
@@ -20,6 +20,7 @@ import org.openid4java.discovery.DiscoveryException;
2020
2121 import java.io.IOException;
2222 import java.util.List;
23+ import java.util.Map;
2324
2425 import javax.servlet.http.HttpSession;
2526
@@ -32,7 +33,10 @@ public class OpenIdBean implements Serializable {
3233 @Inject
3334 private FacesContext context;
3435
35-
36+ private String openid;
37+ public void setOpenid (String openid) { this.openid = openid; }
38+ public String getOpenid () { return openid; }
39+
3640 private static ConsumerManager consumerManager;
3741 public static ConsumerManager getConsumerManager() {
3842 // try {
@@ -89,11 +93,26 @@ public class OpenIdBean implements Serializable {
8993 return ret;
9094 }
9195
92- public void yahooLogin() {
93- log.info("yahoo log in!");
96+ public void doLogin() {
97+
98+ String userSuppliedIdentifier;
99+
100+ Map map = context.getExternalContext().getRequestParameterMap();
101+ String loginTo = (String) map.get("loginTo");
102+ log.info("loginTo: " + loginTo);
103+
104+ if (loginTo.equals("yahoo")) {
105+ userSuppliedIdentifier = "yahoo.co.jp";
106+ }
107+ else if (loginTo.equals("google")) {
108+ userSuppliedIdentifier = "https://www.google.com/accounts/o8/id";
109+ }
110+ else {
111+ userSuppliedIdentifier = openid;
112+ }
113+ //log.info("yahoo log in!");
94114
95115 // Delegate to Open ID code
96- String userSuppliedIdentifier = "yahoo.co.jp";
97116 String returnToUrl = getReturnUrl();
98117 /*
99118 */
Binary files /dev/null and b/WEB-INF/lib/openid4java/aopalliance-1.0.jar differ
Binary files /dev/null and b/WEB-INF/lib/openid4java/commons-logging-1.1.1.jar differ
Binary files /dev/null and b/WEB-INF/lib/openid4java/nekohtml-1.9.10.jar differ
Binary files /dev/null and b/WEB-INF/lib/openid4java/xercesImpl-2.8.1.jar differ
Binary files /dev/null and b/WEB-INF/lib/openid4java/xml-apis-1.3.03.jar differ
--- a/build.xml
+++ b/build.xml
@@ -76,6 +76,7 @@
7676 <fileset dir="${faceletsrc}">
7777 <include name="javascript/*.js"/>
7878 <include name="**/*.html"/>
79+ <include name="**/*.png"/>
7980 <include name="**/*.xhtml"/>
8081 <include name="**/*.properties"/>
8182 </fileset>
Binary files /dev/null and b/img/Red-signin-Long-press-44dp.png differ
--- a/login.xhtml
+++ b/login.xhtml
@@ -28,8 +28,23 @@ password : <h:inputSecret value="#{userBean.pwd}"/>
2828 Open ID log in:
2929 <br />
3030 <h:form>
31- <h:commandLink action="#{openIdBean.yahooLogin}">
31+ <h:commandLink action="#{openIdBean.doLogin}">
3232 <img src="http://i.yimg.jp/images/login/btn/btnXSYid.gif" width="241" height="28" alt="Yahoo! JAPAN IDでログイン" border="0" />
33+ <f:param name="loginTo" value="yahoo" />
34+ </h:commandLink>
35+
36+<br />
37+
38+ <h:commandLink action="#{openIdBean.doLogin}">
39+ <img src="img/Red-signin-Long-press-44dp.png" alt="Google Accountでログイン" border="0" />
40+ <f:param name="loginTo" value="google" />
41+ </h:commandLink>
42+
43+<br />
44+
45+ <h:inputText value="#{openIdBean.openid}" />
46+ <h:commandLink action="#{openIdBean.doLogin}" value="ELSE" >
47+ <f:param name="loginTo" value="else" />
3348 </h:commandLink>
3449 </h:form>
3550