diff --git a/lib/libnfs.c b/lib/libnfs.c index f3c26249..714a3849 100755 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -604,7 +604,7 @@ int nfs_set_auth_context(struct nfs_context *nfs, /* * If not devtest, don't allow auth unless transport is secure. */ - if (nfs->rpc->wanted_xprtsec == RPC_XPRTSEC_NONE) { + if ((nfs->rpc->wanted_xprtsec == RPC_XPRTSEC_NONE) && (strcmp(authtype, "AzAuthAAD") == 0)) { RPC_LOG(nfs->rpc, 1, "Cannot enable auth for xprtsec=none"); return -1; } diff --git a/lib/socket.c b/lib/socket.c index e48c2226..47e60db4 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -383,7 +383,8 @@ rpc_write_to_socket(struct rpc_context *rpc) */ if (rpc->use_azauth && !rpc->auth_context.is_authorized && - !pdu->is_head_prio) { + !pdu->is_head_prio && strcmp(rpc->auth_context.auth_type, + "AzAuthAAD") == 0) { RPC_LOG(rpc, 2, "Not sending queued RPC pdu %p as " "connection is not authorized", pdu); /*