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

Reactive Gateway + Microservice MVC + OAuth2 #13944

Closed
1 task
pascalgrimaud opened this issue Feb 13, 2021 · 3 comments · Fixed by #14010
Closed
1 task

Reactive Gateway + Microservice MVC + OAuth2 #13944

pascalgrimaud opened this issue Feb 13, 2021 · 3 comments · Fixed by #14010
Labels
area: bug 🐛 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: microservice theme: OIDC/OAuth2 theme: reactive ⚛️ Spring WebFlux $500 https://www.jhipster.tech/bug-bounties/
Milestone

Comments

@pascalgrimaud
Copy link
Member

Overview of the issue

Currently, a Reactive Gateway can't communicate with a Microservice MVC, if we use OAuth2.
It works well with JWT.

Motivation for or Use Case

Our Microservices stack should work.

Reproduce the error
  • generate a Microservice MVC, with Entities
  • generate a Reactive Gateway with Entities
  • start all
  • try to access to the microservice

Or you can use this JDL:

application {
 config {
   baseName store
   applicationType gateway
   packageName io.github.pascalgrimaud.store
   serviceDiscoveryType eureka
   authenticationType oauth2
   prodDatabaseType postgresql
   cacheProvider hazelcast
   buildTool maven
   clientFramework angularX
   testFrameworks [cypress]
   reactive true
 }
 entities *
}

application {
 config {
   baseName crm
   applicationType microservice
   packageName io.github.pascalgrimaud.crm
   serviceDiscoveryType eureka
   authenticationType oauth2
   prodDatabaseType mysql
   buildTool maven
   serverPort 8081
   reactive false
 }
 entities *
}

entity Product {
   name String required
   description String
   price BigDecimal required min(0)
   size Size required
   image ImageBlob
}
enum Size {
   S, M, L, XL, XXL
}
entity Customer {
   firstName String required
   lastName String required
   gender Gender required
   email String required pattern(/[a-z0-9._+-]{1,20}@[a-z0-9]{3,15}\.[a-z]{2,4}/)
   phone String required
   addressLine1 String required
   addressLine2 String
   city String required
   country String required
}
enum Gender {
   MALE, FEMALE, OTHER
}
entity ProductOrder {
   placedDate Instant required
   status OrderStatus required
   code String required
   invoiceId String
}
enum OrderStatus {
   COMPLETED, PENDING, CANCELLED
}
entity OrderItem {
   quantity Integer required min(0)
   totalPrice BigDecimal required min(0)
   status OrderItemStatus required
}
enum OrderItemStatus {
   AVAILABLE, OUT_OF_STOCK, BACK_ORDER
}
relationship ManyToOne {
OrderItem{product(name) required} to Product
}
relationship OneToMany {
  Customer{order} to ProductOrder{customer(email) required},
  ProductOrder{orderItem} to OrderItem{order(code) required}
}

service Product, Customer, ProductOrder, OrderItem with serviceClass
paginate Product, Customer, ProductOrder, OrderItem with pagination

/* Entities for Invoice microservice */
entity Invoice {
   code String required
   date Instant required
   details String
   status InvoiceStatus required
   paymentMethod PaymentMethod required
   paymentDate Instant required
   paymentAmount BigDecimal required
}
enum InvoiceStatus {
   PAID, ISSUED, CANCELLED
}
entity Shipment {
   trackingCode String
   date Instant required
   details String
}
enum PaymentMethod {
   CREDIT_CARD, CASH_ON_DELIVERY, PAYPAL
}
relationship OneToMany {
   Invoice{shipment} to Shipment{invoice(code) required}
}
service Invoice, Shipment with serviceClass
paginate Invoice, Shipment with pagination
microservice Customer, Product, ProductOrder, OrderItem, Invoice, Shipment with crm

// will be created under 'docker-compose' folder
deployment {
   deploymentType docker-compose
   appsFolders [store, crm]
   dockerRepositoryName "pascalgrimaud"
   monitoring no
   serviceDiscoveryType eureka
}
Related issues

Following #13855

Suggest a Fix
JHipster Version(s)
JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
@pascalgrimaud
Copy link
Member Author

I'm adding a bug bounty on this, as it needs time to analyze and fix it.
Maybe try to understand why it works for JWT but not for OAuth2?

@pascalgrimaud
Copy link
Member Author

Here the configuration I tested:

  • Reactive Gateway + Microservice Reactive + JWT : 🆗
  • Reactive Gateway + Microservice MVC + JWT : 🆗
  • Reactive Gateway + Microservice Reactive + OAuth2 : 🆗
  • Reactive Gateway + Microservice MVC + OAuth2 : ❌

@pascalgrimaud
Copy link
Member Author

Increasing the bounty as it needed to be fixed, otherwise, there can't be a new release

@pascalgrimaud pascalgrimaud added $500 https://www.jhipster.tech/bug-bounties/ and removed $300 https://www.jhipster.tech/bug-bounties/ labels Feb 19, 2021
murdos added a commit that referenced this issue Feb 19, 2021
@pascalgrimaud pascalgrimaud added this to the v7.0.0-beta.2 milestone Feb 20, 2021
pascalgrimaud pushed a commit that referenced this issue Feb 20, 2021
pascalgrimaud added a commit that referenced this issue Feb 20, 2021
coderguy-tech pushed a commit to coderguy-tech/generator-jhipster that referenced this issue Jun 1, 2021
coderguy-tech pushed a commit to coderguy-tech/generator-jhipster that referenced this issue Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bug 🐛 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: microservice theme: OIDC/OAuth2 theme: reactive ⚛️ Spring WebFlux $500 https://www.jhipster.tech/bug-bounties/
Projects
None yet
1 participant