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

Actuator auditevent doesn't work for Oauth audits. #6146

Closed
kwang1 opened this issue Nov 27, 2018 · 2 comments
Closed

Actuator auditevent doesn't work for Oauth audits. #6146

kwang1 opened this issue Nov 27, 2018 · 2 comments
Assignees
Labels
status: duplicate A duplicate of another issue

Comments

@kwang1
Copy link

kwang1 commented Nov 27, 2018

Summary

I am implementing a Spring Cloud Gateway with Oauth2 authentication. Since the Spring Cloud Gateway is based on reactive streams model, so only Spring Security 5.1.1 or above can be used.

When the gateway is working now, I found the Spring Actuator doesn't audit any login/logout activities.

Actual Behavior

Actuator doesn't trigger any authentication events. I got this by fetching uri /auditevents endpoint.

Expected Behavior

I expect the login/logout events can be triggered and I can fetch them by endpoint /auditevents.

Configuration

buildscript {
  ext {
    artifactoryUrl = ""
    repos = {
      maven {
        url "${artifactoryUrl}/libs-release"
        credentials {
          username "$artifactoryUser"
          password "$artifactoryPassword"
        }
      }
      maven {
        url "https://repo.spring.io/snapshot"
      }
      maven {
        url "https://repo.spring.io/milestone"
      }
    }
  }
  ext['spring-security.version'] = '5.1.1.RELEASE'
  repositories repos

  dependencies {
    //TODO the version should be upgrade to 2.1.0.RELEASE when Spring Gateway 2.1.0.RC is released
    classpath group: 'org.springframework.boot', name: 'spring-boot-gradle-plugin', version: '2.1.0.M3'
  }
}

plugins {
  id 'java'
}

apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

repositories repos

group 'example'
version '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencyManagement {
  imports {
    //TODO this should be upgraded to release version.
    mavenBom "org.springframework.cloud:spring-cloud-dependencies:Greenwich.M1"
  }
}

dependencies {
  implementation("org.springframework.boot:spring-boot-starter-actuator")
  implementation("org.springframework.cloud:spring-cloud-starter")
  implementation("org.springframework.cloud:spring-cloud-starter-gateway")
  implementation("org.springframework.cloud:spring-cloud-starter-netflix-hystrix")
  implementation("org.springframework.boot:spring-boot-starter-webflux")
  implementation("org.springframework.boot:spring-boot-starter-security")
  implementation("org.springframework.cloud:spring-cloud-starter-sleuth")

  implementation("org.springframework.security:spring-security-oauth2-jose")
  implementation("org.springframework.security:spring-security-oauth2-client")

    implementation("org.springframework.cloud:spring-cloud-starter-contract-stub-runner") {
        exclude group: "org.springframework.boot", module: "spring-boot-starter-web"
    }

  implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'

  testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
  testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api' //, version: '5.1.0'
  testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine' //, version: '5.1.0'
  testImplementation group: 'com.jayway.jsonpath', name: 'json-path-assert'
  testImplementation group: 'org.assertj', name: 'assertj-core'
  testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic'
}

Version

Spring Security : 5.1.1.RELEASE
Spring Cloud: Greenwich.M1
Spring Boot: 2.1.0.M3

@rwinch rwinch added the status: duplicate A duplicate of another issue label Nov 29, 2018
@rwinch rwinch self-assigned this Nov 29, 2018
@rwinch
Copy link
Member

rwinch commented Nov 29, 2018

Thanks for the report @kwang1! This is a duplicate of #4961

I'm closing this as a duplicate. If you disagree, please comment/reopen.

@rwinch rwinch closed this as completed Nov 29, 2018
@kwang1
Copy link
Author

kwang1 commented Dec 26, 2018

Thanks @rwinch .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants