Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error during resource access.. #12

Open
nagkumar opened this issue Jan 31, 2018 · 5 comments
Open

error during resource access.. #12

nagkumar opened this issue Jan 31, 2018 · 5 comments

Comments

@nagkumar
Copy link

Can you check your code.. it shows this error.

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer c8365393-f21b-461b-8c54-cbfe649ba6e4" -X GET http://localhost:8000/gigy/people
HTTP/1.1 500
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 31 Jan 2018 08:44:37 GMT
Connection: close

{"timestamp":1517388277830,"status":500,"error":"Internal Server Error","exception":"org.springframework.security.authentication.AuthenticationCredentialsNotFoundException","message":"An Authentication object was not found in the SecurityContext","path":"/gigy/people"}

@chrisoberle
Copy link

I'm seeing this too....however, I'm running the latest release of spring-boot (1.5.10.RELEASE).

@nagkumar
Copy link
Author

Thank You, I ran both on 1.5.10 and 2.0 M7 too same issue.

I am guessing it must be some thing to do with configuration.. it is not able to validate the token generated

@nagkumar
Copy link
Author

nagkumar commented Jan 31, 2018

my suspect.. is that.. spring some thing might have changed here..

https://github.com/gigsterous/gigy-example/blob/master/src/main/java/com/gigy/config/OAuth2Config.java..

pl. check this part of the code..

@Override
	public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
		clients.inMemory().withClient("gigy").secret("secret").accessTokenValiditySeconds(expiration)
				.scopes("read", "write").authorizedGrantTypes("password", "refresh_token").resourceIds("resource");
	}

I am unable to understand what .resourceIds("resource"); mean..

@Smedzlatko
Copy link
Contributor

Hi all,

Sorry for the late response. I just ran the exact same cUrl request against the latest master and got correct response without any errors. Are you sure you have not modified the code?

@nagkumar
Copy link
Author

nagkumar commented Feb 3, 2018

Issue is observed with latest spring release..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants