Giter Site home page Giter Site logo

helloworld-spring-webapp's Introduction

Introduction

This project is a sample of spring and jersey integrated It is based on the helloworld-spring-webapp sample from https://github.com/jersey/jersey/tree/2.6/examples/helloworld-spring-webapp

The pom.xml has been replaced by a build.gradle

The webapp deploy in tomcat and you can invoke it with http://localhost:8080//rest/jersey-hello

tested with Idea and tomcat 7.0.47 Need to test more the gradle plugin: "war"


Securization of the rest resources with spring and oauth2 is under way, but not yet operational

If you reactivate the filters: 'springSecurityFilterChain' and 'oauth2EndpointUrlFilter' in web.xml, rest call fail.

In the end, you should be able to get a token with this call:

curl -X POST -d "client_id=the_client&client_secret=1234567890&grant_type=client_credentials" http://localhost:8080/hello/oauth/token

Right now, this request validate the credential, as indicated by the call with a bad pasword:

$ curl -X POST -d "client_id=the_client&client_secret=badPassword&grant_type=client_credentials" http://localhost:8080/hello/oauth/token
{"error":"invalid_client","error_description":"Bad client credentials"}

But if we pass valid credential, we get a 404:

<h1>HTTP Status 404 - /hello/oauth/token</h1>
Status report</p><p><b>message</b>
<u>/hello/oauth/token</u></p><p><b>description</b>
<u>The requested resource is not available.</u>

and this call:

http://localhost:8080/hello/rest/jersey-hello

return

An Authentication object was not found in the SecurityContextunauthorized

helloworld-spring-webapp's People

Watchers

 avatar  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.