Username and Password in the PacketInterceptor #9
-
Hi, Is it possible to get the authentication information in the packet interceptor? My use case would be to validate that certain user can send information for a topic or validate the payload. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 15 replies
-
Hello, it is possible to pass to the Broker constructor an object of type Authorization, that defines the method |
Beta Was this translation helpful? Give feedback.
Hello, it is possible to pass to the Broker constructor an object of type Authorization, that defines the method
fun authorize(clientId: String, topicName: String, isSubscription: Boolean): Boolean
. There you can define an authorization policy, that method gets called on publish and on subscribe (isSubscription=true). There you have the clientId and the topicName.