%3CLINGO-SUB%20id%3D%22lingo-sub-1173083%22%20slang%3D%22en-US%22%3EAnnouncing%20the%20OAuth%20support%20with%20Event%20Hubs%20for%20Kafka%20-%20now%20GA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1173083%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EEvery%20time%20you%20publish%20or%20consume%20event%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Es%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eto%2F%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Efrom%20Event%20Hubs%20for%20Kafka%2C%20you%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Er%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bclient%20is%20trying%20to%20access%20the%20Event%20Hubs%20resources.%20When%20using%20Apache%20Kafka%20protocol%20with%20your%20clients%2C%20you%20can%20set%20your%20configuration%20for%20authentication%20and%20encryption%20using%20the%20SASL%20mechanisms.%20When%20using%20Event%20Hubs%20for%20Kafka%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bthe%20service%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Brequires%20the%20TLS-encryption%20(as%20all%20data%20in%20transit%20with%20Event%20Hubs%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bfor%20Kafka%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bis%20TLS%20encrypted)%20and%20this%20can%20be%20done%20specifying%20the%20SASL_SSL%20option%20in%20yo%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eur%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Econfiguration%20file.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3EEvent%20Hubs%20for%20Kafka%20initially%20offered%20the%20authentication%20through%20SASL%20PLAIN%20mechanism.%26nbsp%3BWe%20are%20now%20extending%20the%20authentication%20mechanism%20with%20Event%20Hubs%20for%20Kafka%20to%20support%20the%20OAuth%202.0%26nbsp%3Btoken%20based%26nbsp%3Bauthentication.%20With%20this%20kind%20of%20authentication%2C%26nbsp%3BKafka%20clients%20will%20then%20talk%20to%20a%20central%20OAuth%202.0%20compliant%20authorization%20server.%20For%20Azure%20Event%20Hubs%20for%20Kafka%20this%20is%20Azure%20Active%20Directory%20(Azure%20AD).%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A240%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EAzure%20AD%20also%20provides%20Role%20Based%20authorization%20which%20can%20be%20used%20instead%20of%20ACL%20based%20authorization%20to%20centrally%20manage%20not%20only%20user%20entities%2C%20but%20also%20the%20permissions%20they%20have%20on%20Kafka%20resources%20while%20using%20Event%20Hubs.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIntegrating%20with%20Azure%20AD%2C%26nbsp%3BKafka%20clients%20streaming%20through%20Event%20Hubs%20can%20make%20use%20of%20the%20in-built%26nbsp%3Broles%20for%20the%20service.%26nbsp%3BExplore%20the%20built-in%20roles%20and%20resource%20scope%26nbsp%3Bin%20this%20article%20-%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fevent-hubs%2Fauthorize-access-azure-active-directory%23built-in-rbac-roles-for-azure-event-hubs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAuthorize%20access%20to%20Event%20Hubs%20resources%20using%20Azure%20Active%20Directory%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20aria-level%3D%221%22%20id%3D%22toc-hId-1088103824%22%20id%3D%22toc-hId-1088104725%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EHow%20to%20configure%20the%20OAuth2.0%20compatible%20token-based%20mechanism%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A240%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIn%20your%20configuration%20file%2C%26nbsp%3Bspecify%20the%20SASL%20based%20protocol%20option%20and%20specify%20the%20OAUTHBEARER%20mechanism%20along%20with%20the%20callback%20handler%20for%20token%20retrieval%20as%20shown%20below%2C%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3Ebootstrap.servers%3Dmynamespace.servicebus.windows.net%3A9093%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%2C%26quot%3B469777462%26quot%3B%3A%5B916%2C1832%2C2748%2C3664%2C4580%2C5496%2C6412%2C7328%2C8244%2C9160%2C10076%2C10992%2C11908%2C12824%2C13740%2C14656%5D%2C%26quot%3B469777927%26quot%3B%3A%5B0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%5D%2C%26quot%3B469777928%26quot%3B%3A%5B1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%5D%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3Esecurity.protocol%3DSASL_SSL%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%2C%26quot%3B469777462%26quot%3B%3A%5B916%2C1832%2C2748%2C3664%2C4580%2C5496%2C6412%2C7328%2C8244%2C9160%2C10076%2C10992%2C11908%2C12824%2C13740%2C14656%5D%2C%26quot%3B469777927%26quot%3B%3A%5B0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%5D%2C%26quot%3B469777928%26quot%3B%3A%5B1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%5D%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3Esasl.mechanism%3DOAUTHBEARER%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%2C%26quot%3B469777462%26quot%3B%3A%5B916%2C1832%2C2748%2C3664%2C4580%2C5496%2C6412%2C7328%2C8244%2C9160%2C10076%2C10992%2C11908%2C12824%2C13740%2C14656%5D%2C%26quot%3B469777927%26quot%3B%3A%5B0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%5D%2C%26quot%3B469777928%26quot%3B%3A%5B1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%5D%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3Esasl.jaas.config%3Dorg.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule%26nbsp%3Brequired%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%2C%26quot%3B469777462%26quot%3B%3A%5B916%2C1832%2C2748%2C3664%2C4580%2C5496%2C6412%2C7328%2C8244%2C9160%2C10076%2C10992%2C11908%2C12824%2C13740%2C14656%5D%2C%26quot%3B469777927%26quot%3B%3A%5B0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%5D%2C%26quot%3B469777928%26quot%3B%3A%5B1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%5D%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3Esasl.login.callback.handler.class%3DYourCallBackHandler%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%2C%26quot%3B469777462%26quot%3B%3A%5B916%2C1832%2C2748%2C3664%2C4580%2C5496%2C6412%2C7328%2C8244%2C9160%2C10076%2C10992%2C11908%2C12824%2C13740%2C14656%5D%2C%26quot%3B469777927%26quot%3B%3A%5B0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%5D%2C%26quot%3B469777928%26quot%3B%3A%5B1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%5D%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EWith%20OAuth%202.0%20token-based%20mechanism%2C%20you%20can%20make%20use%20of%20the%20built%20in%20RBAC%20roles%20for%20Event%20Hubs%20as%26nbsp%3Blisted%20below%2C%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fbuilt-in-roles%23azure-event-hubs-data-owner%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAzure%20Event%20Hubs%20Data%20owner%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3A%20Use%20this%20role%20to%20give%20complete%20access%20to%20Event%20Hubs%20resources.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559685%26quot%3B%3A570%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fbuilt-in-roles%23azure-event-hubs-data-receiver%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAzure%20Event%20Hubs%20Data%20sender%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3A%20Use%20this%20role%20to%20give%20the%20send%20access%20to%20Event%20Hubs%20resources.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559685%26quot%3B%3A570%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Frole-based-access-control%2Fbuilt-in-roles%23azure-event-hubs-data-sender%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAzure%20Event%20Hubs%20Data%20receiver%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3A%20Use%20this%20role%20to%20give%20the%20consuming%2Freceiving%20access%20to%20Event%20Hubs%20resources.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559685%26quot%3B%3A570%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThe%20following%20list%20also%20describes%20the%20levels%20at%20which%20you%20can%20scope%20access%20to%20Event%20Hubs%20for%20Kafka%20resources%20for%20your%20client%20identities%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%20data-contrast%3D%22none%22%3E%20%3CSTRONG%3ETopics%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%3A%26nbsp%3BRole%20assignment%20applies%20to%20the%26nbsp%3BTopic%20entity%20under%20an%20Event%20Hubs%20namespace%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%20data-contrast%3D%22none%22%3E%20%3CSTRONG%3ENamespace%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3A%20Role%20assignment%20spans%20the%20entire%20topology%20of%26nbsp%3BTopics%26nbsp%3Bunder%20the%20namespace%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3CSTRONG%3EResource%20group%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3A%20Role%20assignment%20applies%20to%20all%20the%20Event%20Hubs%20resources%20under%20the%20resource%20group.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3CSTRONG%3ESubscription%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3A%20Role%20assignment%20applies%20to%20all%20the%20Event%20Hubs%20resources%20in%20all%20resource%20groups%20in%20the%20subscription.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22paragraph%22%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20vertical-align%3A%20baseline%3B%22%3E%3CSPAN%20class%3D%22normaltextrun%22%3E%3CSPAN%20style%3D%22font-size%3A%2016.0pt%3B%20font-family%3A%20'Calibri%20Light'%2Csans-serif%3B%20color%3A%20%232f5496%3B%22%3ETo%20Conclude%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22user-select%3A%20text%3B%20-webkit-user-drag%3A%20none%3B%20-webkit-tap-highlight-color%3A%20transparent%3B%22%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A240%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%3CSPAN%20class%3D%22eop%22%3E%3CSPAN%20style%3D%22font-size%3A%2016.0pt%3B%20font-family%3A%20'Calibri%20Light'%2Csans-serif%3B%20color%3A%20%232f5496%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22normaltextrun%22%3E%3CSPAN%20style%3D%22font-size%3A%2011.0pt%3B%20font-family%3A%20'Calibri'%2Csans-serif%3B%22%3EAzure%20Event%20Hubs%20supports%20authorizing%20to%20Event%20Hubs%20resources%20using%20Azure%20Active%20Directory%20(Azure%20AD).%20Authorizing%20users%20or%20applications%20using%20OAuth%202.0%20token%20returned%20by%20Azure%20AD%20provides%20superior%20security%20and%20ease%20of%20use%20over%20shared%20access%20signatures%20(SAS).%20With%20Azure%20AD%2C%20there%20is%20no%20need%20to%20store%20the%20tokens%20in%20your%20code%20and%20risk%20potential%20security%20vulnerabilities.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22normaltextrun%22%3E%3CSPAN%20style%3D%22font-size%3A%2011.0pt%3B%20font-family%3A%20'Calibri'%2Csans-serif%3B%22%3EMicrosoft%20recommends%20using%20Azure%20AD%20with%20your%20Azure%20Event%20Hubs%20when%20possible.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--719350639%22%20id%3D%22toc-hId--719349738%22%3E%3CSPAN%3ENext%20Steps%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A240%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%20data-wac-het%3D%221%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-event-hubs-for-kafka%2Ftree%2Fmaster%2Ftutorials%2Foauth%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EExplore%20our%20GitHub%20sample%20for%20enabling%20OAuth2.0%20options%20with%20your%20Kafka%20applications%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fevent-hubs%2Fauthorize-access-event-hubs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3ELearn%20more%20about%20authorizing%20access%20to%20Azure%20Event%20Hubs%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fevent-hubs%2Fauthenticate-application%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAuthenticate%20requests%20to%20Azure%20Event%20Hubs%20from%20an%20application%20using%20Azure%20Active%20Directory%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fevent-hubs%2Fauthenticate-managed-identity%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAuthenticate%20a%20managed%20identity%20with%20Azure%20Active%20Directory%20to%20access%20Event%20Hubs%20Resources%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fevent-hubs%2Fauthenticate-shared-access-signature%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAuthenticate%20requests%20to%20Azure%20Event%20Hubs%20using%20Shared%20Access%20Signatures%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fevent-hubs%2Fauthorize-access-azure-active-directory%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAuthorize%20access%20to%20Event%20Hubs%20resources%20using%20Azure%20Active%20Directory%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fevent-hubs%2Fauthorize-access-shared-access-signature%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EAuthorize%20access%20to%20Event%20Hubs%20resources%20using%20Shared%20Access%20Signatures%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1173083%22%20slang%3D%22en-US%22%3E%3CP%3EEvent%20Hubs%20for%20Kafka%20offers%20authentication%20through%20SASL%20based%20protocol%20options.%20Along%20with%20the%20SASL%20PLAIN%20authentication%20mechanism%20the%20SASL%20OAUTHBEARER%20is%20also%20now%20supported.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1173083%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eapache%20kafka%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Event%20Hubs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Estreaming%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E

Every time you publish or consume events to/from Event Hubs for Kafka, your client is trying to access the Event Hubs resources. When using Apache Kafka protocol with your clients, you can set your configuration for authentication and encryption using the SASL mechanisms. When using Event Hubs for Kafka the service requires the TLS-encryption (as all data in transit with Event Hubs for Kafka is TLS encrypted) and this can be done specifying the SASL_SSL option in your configuration file.  

Event Hubs for Kafka initially offered the authentication through SASL PLAIN mechanism. We are now extending the authentication mechanism with Event Hubs for Kafka to support the OAuth 2.0 token based authentication. With this kind of authentication, Kafka clients will then talk to a central OAuth 2.0 compliant authorization server. For Azure Event Hubs for Kafka this is Azure Active Directory (Azure AD).  

 

Azure AD also provides Role Based authorization which can be used instead of ACL based authorization to centrally manage not only user entities, but also the permissions they have on Kafka resources while using Event Hubs. 

 

Integrating with Azure AD, Kafka clients streaming through Event Hubs can make use of the in-built roles for the service. Explore the built-in roles and resource scope in this article - Authorize access to Event Hubs resources using Azure Active Directory 

 

How to configure the OAuth2.0 compatible token-based mechanism   

 

In your configuration file, specify the SASL based protocol option and specify the OAUTHBEARER mechanism along with the callback handler for token retrieval as shown below, 

bootstrap.servers=mynamespace.servicebus.windows.net:9093 

security.protocol=SASL_SSL 

sasl.mechanism=OAUTHBEARER 

sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required; 

sasl.login.callback.handler.class=YourCallBackHandler; 

 

With OAuth 2.0 token-based mechanism, you can make use of the built in RBAC roles for Event Hubs as listed below, 

 

The following list also describes the levels at which you can scope access to Event Hubs for Kafka resources for your client identities 

  • Topics: Role assignment applies to the Topic entity under an Event Hubs namespace 
  • Namespace: Role assignment spans the entire topology of Topics under the namespace  
  • Resource group: Role assignment applies to all the Event Hubs resources under the resource group. 
  • Subscription: Role assignment applies to all the Event Hubs resources in all resource groups in the subscription. 

To Conclude 

Azure Event Hubs supports authorizing to Event Hubs resources using Azure Active Directory (Azure AD). Authorizing users or applications using OAuth 2.0 token returned by Azure AD provides superior security and ease of use over shared access signatures (SAS). With Azure AD, there is no need to store the tokens in your code and risk potential security vulnerabilities.

Microsoft recommends using Azure AD with your Azure Event Hubs when possible.

 

Next Steps