Giter Site home page Giter Site logo

onboarding-spring's Introduction

#Vauhtio template Spring project

###REST Controller Rest endpointit on projektissa luokassa VauhtioRestController

Luokka esittelee variaatiot:

  1. pelkkä GET ilman parametreja
  2. GET url polkumuuttujalla
  3. GET requst pararametreilla (?name=value&next=param)
  4. POST Json datalla
  5. HTTP Basic autentikaatiolla suojattu GET

###Spring security Spring security on konfiguroitu projektissa luokassa WebSecurityConfig Testaa seuraavat variaatiot:

  1. selaimella suojaamaton URL vastaa ilman autentikaatiota http://localhost:8080/
  2. selaimella uusi ikkkuna incognito modella; navigoi http://localhost:8080/secure/sensitive ja anna kt:ss admin:admin
  3. tekninen kutsu ilman tunnuksia; curl -i http://localhost:8080/secure/sensitive
    1. palauttaa 401 Unauthorized
  4. tekninen kutsu the-easy-way; curl -i --user admin:admin http://localhost:8080/secure/sensitive
  5. tekninen kutsu the-hard-and-real-way:
    1. mene https://www.base64encode.org ja syötä kenttään admin:admin (huomaa kaksoispiste kuuluu mukaan)
    2. paina Encode
    3. kopioi base64 enkoodattu teksti (YWRtaW46YWRtaW4=)
    4. curl -i -H "Authorization: Basic YWRtaW46YWRtaW4=" http://localhost:8080/secure/sensitive

Viimeisessä esimerkissä nähtiin miten Authorization Headeriin oli laitettu enkoodattuna käyttäjätunnus:salasana. HUOM! Älä koskaan käytä https://www.base64encode.org linkkiä minkään tuotantodatan enkoodaamiseen, harjoituskäyttäjät ok. Tämä siitä syystä että tulet lähettäneeksi tiedot palveluntarjoajalle ja emme voi varmistua mitä datalla tehdään.

onboarding-spring's People

Watchers

James Cloos avatar Henrik Raitasola 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.