Coder Social home page Coder Social logo

spring-oauth2-jpa-example's Introduction

Hi there πŸ‘‹

I am a software engineer specializing in designing architectures and writing software to deploy highly available and scalable ML/AI services.

When I have some spare time, I enjoy writing about Software architecture, Artificial Intelligence and Cloud computing.

Currently working at Spotify, previously employed at Vodafone and Unicredit bank.

I love contributing to open source projects, eat delicious food, drink good wine and watch memorable movies.

Getting in touch πŸ“«

Easiest way to get in touch with me is through LinkedIn or Email. Feel free to write me!

arocketman | mail arocketman | YouTube arocketman | LinkedIn


Latest Articles - technicals πŸ’»

Latest projects and contributions (sampled) πŸ› 

Latest Articles - misc ⚑


Stats

arocketman's github stats

spring-oauth2-jpa-example's People

Contributors

arocketman avatar tonnix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-oauth2-jpa-example's Issues

Getting 404 if send access_token with request.

Hi Arocketman

Thanks for the sample application its of great help. But I am facing a problem. I have successfully generated the token but while send request to protected resource with access token it gives me 404 not found.Can you please look at the issue.

{
"timestamp": 1499576683397,
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/private"
}

Urls are not getting authenticated

Hello,

I have followed your video on youtube "Secure REST API with authentication using Spring Boot , Security , OAuth2 and JPA."

I am getting access_tokens for grant_type =password and client_credentials.
But the thing is, my REST api urls are not getting authenticated. i.e. they are working without access_token
PFB:
public void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers("/").permitAll() .antMatchers(SecurityRestEndPoints.SECURITY_BASE_V1 + "/**").authenticated(); }

Kindly, let me know what should I change to make it workable.

Thanks,
Siddharth

Add video link in the README

I found this repo through Google and I wasn't aware that there is a video for it (found the link in a closed issue).
I think it would be nice to add the link to README, so people who find it like me will know about it.

How to migrate to Spring Boot 2.0.0

I'm novice using Spring Boot.
Your sample project works on Spring Boot 1.5.x
But when trying running on 2.0.0 throws this:

Description:

Field authenticationManager in com.mh.sgmun.configuration.AuthorizationServerConfiguration required a bean of type 'org.springframework.security.authentication.AuthenticationManager' that could not be found.

Action:

Consider defining a bean of type 'org.springframework.security.authentication.AuthenticationManager' in your configuration.

Writing Test cases

Hello,

I have seen that the project gives a good example, but I do not see test cases written.
I have written a code for test cases.

I have written a test case for the home page, it is working fine.
but I face an issue that there is an issue related to function obtain tokens.

It returns status code 401 although it should return status code 200 Ok

`

   private String obtainAccessToken(String username, String password) throws Exception {     
   MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
    params.add("grant_type", "password");
   params.add("client_id", "my-trusted-client");
    params.add("username", "user");
    params.add("password", "user");

    ResultActions result 
      = mockMvcURLAuthenication.perform(post("/oauth/token")
      .params(params)
      .with(httpBasic("my-trusted-client",passwordEncoder.encode("secret")))
      .accept("application/json;charset=UTF-8"))
      .andExpect(status().isOk());
      
    String resultString = result.andReturn().getResponse().getContentAsString();
 
    JacksonJsonParser jsonParser = new JacksonJsonParser();
    return jsonParser.parseMap(resultString).get("access_token").toString();
}

`
Thanks

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.