GithubHelp home page GithubHelp logo

liuzchao / spring-boot-security-and-session Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cosmic-cowboy/spring-boot-security-and-session

0.0 1.0 0.0 260 KB

Spring Bootでの認証・認可・セッションの動作を確認する

Java 94.24% HTML 5.76%

spring-boot-security-and-session's Introduction

Spring Bootでの認証・認可・セッションの動作を確認する

spring-boot-form-and-basic-authプロジェクト

https://github.com/cosmic-cowboy/spring-boot-security-and-session/tree/master/spring-boot-form-and-basic-auth

目的

basic認証とフォーム認証を併用する(Multiple HttpSecurity)動作を確認する

http://docs.spring.io/spring-security/site/docs/4.0.0.RELEASE/reference/htmlsingle/#multiple-httpsecurity

basic認証(API)

ログイン

$ curl -v -X GET "http://localhost:8080/api/login" -u user01:{password}

WebSocket通信

$ curl -v "http://localhost:8080/api/echo" -N -u user01:{password} -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: `perl -MMIME::Base64 -e 'print encode_base64("13-hogehgeo")'`"

フォーム認証(webページ)

ログインフォーム

http://localhost:8080/admin/loginForm

spring-sessionプロジェクト

https://github.com/cosmic-cowboy/spring-boot-security-and-session/tree/master/spring-session

目的

Spring Sessionの動作を確認する

http://projects.spring.io/spring-session/

APIs

ログイン(x-auth)

$ curl -v -X GET "http://localhost:8080/" -u user01:{password}

ログアウト(x-auth)

$ curl -v -H 'x-auth-token:{token}' http://localhost:8080/logout

ブックマーク

$ curl -v -H 'x-auth-token:{token}' http://localhost:8080/bookmark

各プロジェクト共通

Requirements

redisのインストールと起動(spring-sessionプロジェクトで使用)

http://redis.io/

$ redis-server /usr/local/etc/redis.conf

java,maven

Running

$ mvn spring-boot:run

Debug

Eclipseなどを使って5005ポートでリモート・デバッグしてください。

$ mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"

spring-boot-security-and-session's People

Contributors

cosmic-cowboy avatar

Watchers

Luke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.