Coder Social home page Coder Social logo

Comments (10)

dsyer avatar dsyer commented on May 28, 2024

::jar is a non-existent dependency so it's not that it's missing from a repository. How did you install the CLI plugins? What do you have in "SPRING_HOME/lib"?

from spring-cloud-security.

ryanjbaxter avatar ryanjbaxter commented on May 28, 2024

To tell you the truth, I am not really sure how I installed the CLI, it has
been a while since I did it. Is SPRING_HOME an environment variable? It
doesn't appear to be set in my environment....

from spring-cloud-security.

dsyer avatar dsyer commented on May 28, 2024

This will not work with Spring Cloud (No plugins):

$ ls $(dirname `which spring`)/../lib
spring-boot-cli-1.2.0.BUILD-SNAPSHOT.jar

This will:

$ ls $(dirname `which spring`)/../lib
bcpkix-jdk15on-1.47.jar  spring-boot-cli-1.1.5.RELEASE.jar          spring-security-crypto-3.2.4.RELEASE.jar
bcprov-jdk15on-1.47.jar  spring-cloud-cli-1.0.0.BUILD-SNAPSHOT.jar  spring-security-rsa-1.0.0.M2.jar
install-0.0.1.jar        spring-core-4.0.6.RELEASE.jar

from spring-cloud-security.

ryanjbaxter avatar ryanjbaxter commented on May 28, 2024

Here is what I see

bcpkix-jdk15on-1.47.jar spring-cloud-cli-1.0.0.BUILD-SNAPSHOT.jar
bcprov-jdk15on-1.47.jar spring-core-4.0.7.RELEASE.jar
install-0.0.1.jar spring-security-crypto-3.2.5.RELEASE.jar
spring-boot-cli-1.1.7.RELEASE.jar spring-security-rsa-1.0.0.M2.jar

from spring-cloud-security.

dsyer avatar dsyer commented on May 28, 2024

Looks OK. What is your app.groovy?

from spring-cloud-security.

ryanjbaxter avatar ryanjbaxter commented on May 28, 2024

Here is what is in my

@Grab('spring-boot-starter-security')
@Controller
@EnableOAuth2Sso
class Application {

  @RequestMapping('/')
  String home() {
    'Hello World'
  }

}

I just ran spring run again and I am getting slightly different errors, not
sure why it is different.

$ spring run app.groovy
Resolving dependencies........
startup failed:
file:/Users/ryanjbaxter/groovy/spring-cloud-security/app.groovy: -1: unable
to resolve class org.springframework.cloud.cloudfoundry.sso.EnableOAuth2Sso
 @ line -1, column -1.
file:/Users/ryanjbaxter/groovy/spring-cloud-security/app.groovy: -1: unable
to resolve class
org.springframework.cloud.cloudfoundry.sso.OAuth2SsoConfigurerAdapter
 @ line -1, column -1.
2 errors

from spring-cloud-security.

dsyer avatar dsyer commented on May 28, 2024

I'd say you have an old snapshot (pre M1) of spring-cloud-cli in that lib folder. You should be able to just build that locally and overwrite the jar file.

from spring-cloud-security.

ryanjbaxter avatar ryanjbaxter commented on May 28, 2024

This is turning into a bit of a nightmare....

So I can't build spring-cloud-cli until I build spring-cloud-netflix and
spring-cloud-config. So I went to go build spring-cloud-config and got
test failures, is there something I need to do to get these tests to pass?

-------------------------------------------------------------------------------
Test set: org.springframework.cloud.config.server.EncryptionControllerTests
-------------------------------------------------------------------------------
Tests run: 10, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.529 sec
<<< FAILURE! - in
org.springframework.cloud.config.server.EncryptionControllerTests
sunnyDayRsaKey(org.springframework.cloud.config.server.EncryptionControllerTests)
 Time elapsed: 0.326 sec  <<< ERROR!
java.lang.IllegalArgumentException: Unable to initialize due to invalid
secret key
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1024)
at javax.crypto.Cipher.implInit(Cipher.java:790)
at javax.crypto.Cipher.chooseProvider(Cipher.java:849)
at javax.crypto.Cipher.init(Cipher.java:1348)
at javax.crypto.Cipher.init(Cipher.java:1282)
at
org.springframework.security.crypto.encrypt.CipherUtils.initCipher(CipherUtils.java:105)
at
org.springframework.security.crypto.encrypt.AesBytesEncryptor.encrypt(AesBytesEncryptor.java:65)
at
org.springframework.security.rsa.crypto.RsaSecretEncryptor.encrypt(RsaSecretEncryptor.java:122)
at
org.springframework.security.rsa.crypto.RsaSecretEncryptor.encrypt(RsaSecretEncryptor.java:104)
at
org.springframework.security.rsa.crypto.RsaSecretEncryptor.encrypt(RsaSecretEncryptor.java:90)
at
org.springframework.cloud.config.server.EncryptionController.encrypt(EncryptionController.java:150)
at
org.springframework.cloud.config.server.EncryptionControllerTests.sunnyDayRsaKey(EncryptionControllerTests.java:70)

sunnyDaySymmetricKey(org.springframework.cloud.config.server.EncryptionControllerTests)
 Time elapsed: 0.012 sec  <<< ERROR!
java.lang.IllegalArgumentException: Unable to initialize due to invalid
secret key
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1024)
at javax.crypto.Cipher.implInit(Cipher.java:790)
at javax.crypto.Cipher.chooseProvider(Cipher.java:849)
at javax.crypto.Cipher.init(Cipher.java:1348)
at javax.crypto.Cipher.init(Cipher.java:1282)
at
org.springframework.security.crypto.encrypt.CipherUtils.initCipher(CipherUtils.java:105)
at
org.springframework.security.crypto.encrypt.AesBytesEncryptor.encrypt(AesBytesEncryptor.java:65)
at
org.springframework.security.crypto.encrypt.HexEncodingTextEncryptor.encrypt(HexEncodingTextEncryptor.java:36)
at
org.springframework.cloud.config.server.EncryptionController.encrypt(EncryptionController.java:150)
at
org.springframework.cloud.config.server.EncryptionControllerTests.sunnyDaySymmetricKey(EncryptionControllerTests.java:63)

decryptEnvironment(org.springframework.cloud.config.server.EncryptionControllerTests)
 Time elapsed: 0.007 sec  <<< ERROR!
java.lang.IllegalArgumentException: Unable to initialize due to invalid
secret key
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1024)
at javax.crypto.Cipher.implInit(Cipher.java:790)
at javax.crypto.Cipher.chooseProvider(Cipher.java:849)
at javax.crypto.Cipher.init(Cipher.java:1348)
at javax.crypto.Cipher.init(Cipher.java:1282)
at
org.springframework.security.crypto.encrypt.CipherUtils.initCipher(CipherUtils.java:105)
at
org.springframework.security.crypto.encrypt.AesBytesEncryptor.encrypt(AesBytesEncryptor.java:65)
at
org.springframework.security.crypto.encrypt.HexEncodingTextEncryptor.encrypt(HexEncodingTextEncryptor.java:36)
at
org.springframework.cloud.config.server.EncryptionController.encrypt(EncryptionController.java:150)
at
org.springframework.cloud.config.server.EncryptionControllerTests.decryptEnvironment(EncryptionControllerTests.java:93)

formDataIn(org.springframework.cloud.config.server.EncryptionControllerTests)
 Time elapsed: 0.129 sec  <<< ERROR!
java.lang.IllegalArgumentException: Unable to initialize due to invalid
secret key
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1024)
at javax.crypto.Cipher.implInit(Cipher.java:790)
at javax.crypto.Cipher.chooseProvider(Cipher.java:849)
at javax.crypto.Cipher.init(Cipher.java:1348)
at javax.crypto.Cipher.init(Cipher.java:1282)
at
org.springframework.security.crypto.encrypt.CipherUtils.initCipher(CipherUtils.java:105)
at
org.springframework.security.crypto.encrypt.AesBytesEncryptor.encrypt(AesBytesEncryptor.java:65)
at
org.springframework.security.rsa.crypto.RsaSecretEncryptor.encrypt(RsaSecretEncryptor.java:122)
at
org.springframework.security.rsa.crypto.RsaSecretEncryptor.encrypt(RsaSecretEncryptor.java:104)
at
org.springframework.security.rsa.crypto.RsaSecretEncryptor.encrypt(RsaSecretEncryptor.java:90)
at
org.springframework.cloud.config.server.EncryptionController.encrypt(EncryptionController.java:150)
at
org.springframework.cloud.config.server.EncryptionControllerTests.formDataIn(EncryptionControllerTests.java:85)

randomizedCipher(org.springframework.cloud.config.server.EncryptionControllerTests)
 Time elapsed: 0.003 sec  <<< ERROR!
java.lang.IllegalArgumentException: Unable to initialize due to invalid
secret key
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1024)
at javax.crypto.Cipher.implInit(Cipher.java:790)
at javax.crypto.Cipher.chooseProvider(Cipher.java:849)
at javax.crypto.Cipher.init(Cipher.java:1348)
at javax.crypto.Cipher.init(Cipher.java:1282)
at
org.springframework.security.crypto.encrypt.CipherUtils.initCipher(CipherUtils.java:105)
at
org.springframework.security.crypto.encrypt.AesBytesEncryptor.encrypt(AesBytesEncryptor.java:65)
at
org.springframework.security.crypto.encrypt.HexEncodingTextEncryptor.encrypt(HexEncodingTextEncryptor.java:36)
at
org.springframework.cloud.config.server.EncryptionController.encrypt(EncryptionController.java:150)
at
org.springframework.cloud.config.server.EncryptionControllerTests.randomizedCipher(EncryptionControllerTests.java:104)

from spring-cloud-security.

dsyer avatar dsyer commented on May 28, 2024

Ping. I assume this is working now? Maybe you need the JCE extensions in the JDK?

from spring-cloud-security.

ryanjbaxter avatar ryanjbaxter commented on May 28, 2024

You can go ahead and close this, when I get back to the Groovy stuff I will give it another shot. Been focusing on the Java version as you know ;)

from spring-cloud-security.

Related Issues (20)

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.