Code Monkey home page Code Monkey logo

Comments (3)

dcristoloveanu avatar dcristoloveanu commented on July 17, 2024

@ahmedawad1 Sorry for the delay in the reply.

I'd like to look at this, so to go directly to the issue, can you share the format of your connection string that you pass to EventHubClient_CreateFromSASToken?

Please change/mangle any credentials in it (do not post the real event hub name, mangle the SHA of your token, etc.) I am only interested in the format, not the actual contents of it.

Thanks!
/Dan

from azure-event-hubs-c.

ahmedawad1 avatar ahmedawad1 commented on July 17, 2024

Hi Dan,

the SAS token that I use looks like the following:
the XXX corresopnds to my service bus name and AAAA to my eventhub name,

const char* SAS_TOKEN = "SharedAccessSignature sr=sb%3a%2f%2fXXX.servicebus.windows.net%2fAAAA&sig=lXyOG%2bVWSO2PnoppT01Zx206%2bu00SWQuE4dvg1OZFL8%3d&se=1520405013&skn=RootManage";

please note also that I do not have publishers which was ok because I use the same SAS token to communicate with my eventhub in another UAMQP-SDK. For this reasons I found that some sources in the implemented library must accept publishers, I tried to trace the error I got previously and debugging till I modified the following sources (eventhubclient_ll.c , eventhubauth.c) and rebuilt the library with the modified versions. Please find them attached. After the modifications I did, it is somehow connected with the eventhub but then the connection was lost, which left me in buzzle.

For easy reaching, I modified the function "EventHubAuthCBS_SASTokenParse" in eventhubauth.c and some other functions and added log messages to understand what is happening.

Please use the compare plugin in notpad++ to see easily the differences between the modified files and the original hosted on the github.

maybe there could be a bug @ if (secondsSinceEpoch < eventHubAuth->extSASTokenExpTSInEpochSec), I think it should be greater and not less.

Please see the differences and tell me your opinion.
Thanks very much again!

files.zip

from azure-event-hubs-c.

ssdbest avatar ssdbest commented on July 17, 2024

Similar issue is logged here : #61
I have by-passed if (secondsSinceEpoch < eventHubAuth->extSASTokenExpTSInEpochSec) and got Invalid audience error.
To fix this, sent decode url to cbs_put_token() which resulted in "Invalid Signature error"

from azure-event-hubs-c.

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.