/** * Generate a random authorization code and create an AuthorizationCodeEntity, * which will be stored in the repository. * * @param authentication the authentication of the current user, to be retrieved when the * code is consumed * @return the authorization code */ @Override @Transactional(value="defaultTransactionManager") public String createAuthorizationCode(OAuth2Authentication authentication) { String code = generator.generate(); // attach the authorization so that we can look it up later AuthenticationHolderEntity authHolder = new AuthenticationHolderEntity(); authHolder.setAuthentication(authentication); authHolder = authenticationHolderRepository.save(authHolder); // set the auth code to expire Date expiration = new Date(System.currentTimeMillis() + (getAuthCodeExpirationSeconds() * 1000L)); AuthorizationCodeEntity entity = new AuthorizationCodeEntity(code, authHolder, expiration); repository.save(entity); return code; }
ahe.setAuthentication(auth); } else { logger.debug("Found unexpected entry");
ahe.setAuthentication(auth); } else { logger.debug("Found unexpected entry");
@Override public DeviceCode approveDeviceCode(DeviceCode dc, OAuth2Authentication auth) { DeviceCode found = repository.getById(dc.getId()); found.setApproved(true); AuthenticationHolderEntity authHolder = new AuthenticationHolderEntity(); authHolder.setAuthentication(auth); found.setAuthenticationHolder(authHolder); return repository.save(found); }
authHolder.setAuthentication(authentication); authHolder = authenticationHolderRepository.save(authHolder); token.setAuthenticationHolder(authHolder);
OAuth2AccessTokenEntity token = new OAuth2AccessTokenEntity(); AuthenticationHolderEntity authHolder = new AuthenticationHolderEntity(); authHolder.setAuthentication(o2auth); authHolder = authenticationHolderRepository.save(authHolder);
authHolder.setAuthentication(authentication); authHolder = authenticationHolderRepository.save(authHolder);
/** * Generate a random authorization code and create an AuthorizationCodeEntity, * which will be stored in the repository. * * @param authentication the authentication of the current user, to be retrieved when the * code is consumed * @return the authorization code */ @Override @Transactional(value="defaultTransactionManager") public String createAuthorizationCode(OAuth2Authentication authentication) { String code = generator.generate(); // attach the authorization so that we can look it up later AuthenticationHolderEntity authHolder = new AuthenticationHolderEntity(); authHolder.setAuthentication(authentication); authHolder = authenticationHolderRepository.save(authHolder); // set the auth code to expire Date expiration = new Date(System.currentTimeMillis() + (getAuthCodeExpirationSeconds() * 1000L)); AuthorizationCodeEntity entity = new AuthorizationCodeEntity(code, authHolder, expiration); repository.save(entity); return code; }
@Override public DeviceCode approveDeviceCode(DeviceCode dc, OAuth2Authentication auth) { DeviceCode found = repository.getById(dc.getId()); found.setApproved(true); AuthenticationHolderEntity authHolder = new AuthenticationHolderEntity(); authHolder.setAuthentication(auth); found.setAuthenticationHolder(authHolder); return repository.save(found); }
ahe.setAuthentication(auth); } else { logger.debug("Found unexpected entry");
ahe.setAuthentication(auth); } else { logger.debug("Found unexpected entry");
authHolder.setAuthentication(authentication); authHolder = authenticationHolderRepository.save(authHolder); token.setAuthenticationHolder(authHolder);
authHolder.setAuthentication(authentication); authHolder = authenticationHolderRepository.save(authHolder); token.setAuthenticationHolder(authHolder);
OAuth2AccessTokenEntity token = new OAuth2AccessTokenEntity(); AuthenticationHolderEntity authHolder = new AuthenticationHolderEntity(); authHolder.setAuthentication(o2auth); authHolder = authenticationHolderRepository.save(authHolder);
authHolder.setAuthentication(authentication); authHolder = authenticationHolderRepository.save(authHolder);