[精讚] [會員登入]
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] 撰寫驗證伺服器 #3 -- 建立IDP伺服器 僅僅只是做個記錄,這篇的參考效用非常之微小

如何在linux下執行java 原生的java應用程式可以使用簡單的方法在console下面寫出來,適合作簡單的應用

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

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

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

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

我有話要說

>>

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

訪客留言

[無留言]

隨機好文

[jQuery] 利用load()來達成ajax的寫法 jQuery中利用load()來達成ajax的寫法,也有人稱他是假的ajax,作法就是..

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

沒有非誰做不可的事,也沒有不可被取代的人 沒有非誰做不可的事,也沒有不可被取代的人

[CodeIgniter3] 解決無法上傳特定檔案(.sb2)的問題 上傳時出現The filetype you are attempting to upload is not allowed,要怎麼解決?

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