Implementation of Oauth token generator with feign client #1
Merged
amalka.subasinghe
merged 9 commits from tharusha/oauth-extensions:feign_client_impl
into master
1 month ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'tharusha/oauth-extensions:feign_client_impl'
Deleting a branch is permanent. It CANNOT be undone. Continue?
private String refreshToken;
@Value("${jwt-token}")
private String jwtToken;
why is this annotated with @value?
@Component
public class TokenDataHolder {
private String access_token;
use camel case for variable definition
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
do we really need these files?
switch (grantType) {
case "implicit":
Grant type is not mentioned in latest APIM Docs.
remove this, since if not implemented can be return from default case.
if (errorMessage != null && errorMessage.contains("[401]")) {
log.error("Client credentials or client secret is incorrect: {}", errorMessage);
return createErrorResponse(500,
status code should be 401
<?xml version="1.0" encoding="UTF-8"?>
no licence header
<version>3.3.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>io.entgra</groupId>
project folder name - oauth-token-generator
group id - io.entgra.oauth.token.generator
artifact id - oauth-token-generator
version - 1.0-SNAPSHOT
package io.entgra.auth_token_getter;
package name io.entgra.oauth.token.generator
package io.entgra.auth_token_getter;
/*
licence should be the first one in the class
// Method to fetch the token and store it in TokenDataHolder
public ResponseEntity<Object> fetchToken(String scope) {
// Basic validation for required fields
if (clientId == null || clientId.isEmpty()) {
you can use StringUtils here
#spring.application.name=auth_token_getter
auth_token_generation_uri=https://mgt.sg.local/
client-id=AtczeBBwunLMt7Ol4Xc7eNDEuXsa
client-secret=DX8dGTmN7elF3zQsSfbH4yjVm08a
use one pattern to define keys here either . - or _
#grant-type=password
refresh-token=""
jwt-token =""
saml2-assertion=""
why configurong refresh tokens, jwt tokens and saml2-assertion
package io.entgra.auth_token_getter;
no licence headers
408c350c82
into master 1 month agoReviewers
408c350c82
.