[精讚] [會員登入]
527

[JAVA] 撰寫驗證伺服器 #2 -- 安裝測試專案

僅僅只是做個記錄,這篇的參考效用非常微小

分享此文連結 //n.sfs.tw/11639

分享連結 [JAVA] 撰寫驗證伺服器 #2 -- 安裝測試專案@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2017-09-25 21:09:22 最後編修
2017-08-17 11:31:39 By 張○○
 

自動目錄

建立測試用的專案

測試用的專案主要目的是呼叫前面 [JAVA] 撰寫驗證伺服器 #1寫的認證IDP專案

一、克隆專案

上面的選單[Team]->[Remote]->[Clone...]

URL貼上網址 https://oidcrs.tanet.edu.tw/shengche/cncauthdemo
帳密是OIDC的帳密,按[Next]選擇分枝[master*]按完成

二、引入你的專案

開啟 pom.xml

到dependenciey 按滑鼠右鍵 選擇[Insert Code]

選擇[Dependency...]

在Query欄位打入你的專案名稱,會出現你的專案,點開後選擇版本即可,按[Add]完成

這時 pom.xml 會多一個你的dependency,目前看起來像這樣

    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>cnclibs</artifactId>
            <version>0.0.3</version>
        </dependency>
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>rest</groupId>
            <artifactId>IDP001</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>

三、測試

在netbean中測試

到你的專案按滑鼠右鍵選[properties],左邊目錄選擇[Run]右邊的 Arguments打入 -u user -p pass

直接執行netbean的Run

在命令列中下指令

build 你的專案,找到你的專案目錄

一般而言會在家目錄中

你的家目錄中/NetBeansProjects/cncauthdemo/target/
$ java -jar cncauthdemo-0.0.1.jar -u user -p passwd

執行結果範例

user:passwd
Load Service
31 八月 2017 13:34:24,584 authentication.AuthenticationService authentication.AuthenticationService.getInstance(AuthenticationService.java:39)
Service Loading...
31 八月 2017 13:34:24,593 authentication.AuthenticationService authentication.AuthenticationService.doAuthenticate(AuthenticationService.java:49)
Load providers
31 八月 2017 13:34:24,596 authentication.AuthenticationService authentication.AuthenticationService.doAuthenticate(AuthenticationService.java:51)
Check providers
31 八月 2017 13:34:24,601 authentication.myAuth authentication.myAuth.doAuthenticate(myAuth.java:31)
username:user
password:passwd
31 八月 2017 13:34:24,601 authentication.myAuth authentication.myAuth.doAuthenticate(myAuth.java:35)
AXER Implementation
models.edumodel.ExchangeDataModel@27c6e487[username=<null>,fullname=AXER,email=axeredu@edu.tw,schoolid=<null>,titles=<null>,classinfo=<null>,educloudroles=<null>,guid=<null>,pid=<null>,openid=<null>]
31 八月 2017 13:34:24,662 authentication.myAuth authentication.myAuth.doAuthenticate(myAuth.java:38)
models.edumodel.ExchangeDataModel@27c6e487[username=<null>,fullname=AXER,email=axeredu@edu.tw,schoolid=<null>,titles=<null>,classinfo=<null>,educloudroles=<null>,guid=<null>,pid=<null>,openid=<null>]

 

END

你可能感興趣的文章

[JAVA] 撰寫驗證伺服器 #2 -- 安裝測試專案 僅僅只是做個記錄,這篇的參考效用非常微小

[JAVA] JWS, JWT, JWE, JOSE是什麼? [JAVA] JWS, JWT, JWE, JOSE是什麼?非常的複雜,儘量來搞清楚..

[Wildfly10] 發佈war檔 deploy war file onto wildfly10

在Centos7 下安裝 Wildfly10 wildfly以前叫JBoss,2014.11.20改名叫Wildfly,起始版本是Wildfly8,現在已經出到Wil

[JAVA] 撰寫驗證伺服器 #1 僅僅只是做個記錄,這篇的參考效用不大

[NetBeans] 使用git複製別人的專案 NetBeans使用git複製別人的專案及版本控制

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

為什麼要買長達二十年的保單? 為什麼要買長達二十年的保單?找一個可以說服我買二十年保單的理由。

[札記] 2016.7~12月札記 札記,只是札記

NETCRAFT發現你的網站及作業系統 NETCRAFT可以發現你的網站及作業系統

魔球中小女孩唱的歌 The show 魔球中小女孩唱的歌 The show

[AS3] 我做的唯一一個Flash As3遊戲UFO INVADSION [AS3] 我做的唯一一個Flash As3遊戲,是第一個也是最後一個,後來就沒再寫as3,不過as3還滿好玩的。