-
Notifications
You must be signed in to change notification settings - Fork 71
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
Accept getToken callback in AgoraConnectionData #153
Comments
passing a closure would be a really nice option! the only awkward thing is it would then have three separate options; token url, temp token, and a “get token” callback. this could be done with ios/swift using an enum with an associated types: enum TokenType {
case tempToken(String)
case tokenUrl(String)
case getToken((channel: String) -> String?)
}
obj.token = .getToken({…})
// or .tempToken(“abcde”) is something similar possible in Dart? |
I don't think dart support that. |
And changing the existing API for ConnectionData would cause an issue. I've seen that the SDK uses the tokenUrl to generate tokens for both RTC & RTM (if enabled). To support both scenarios we might need to add two separate callback parameters.
Another thing I've noticed is that the SDK is using the deprecated routes for |
If you want I can make a PR on this issue. |
damn @iamriajul, you're pretty quick - I only added the |
Is your feature request related to a problem? Please describe.
I've my agora-token-service deployed but is not exposed as a public API, What we do is we have our API endpoint which verifies authentication and type of user the currently authenticated, and other business logic and then based on that data we generate a token using the agora-token-service, and also we deny with error message in-case the authenticated user doesn't satisfy business logic or don't have access to that channel.
Describe the solution you'd like
I want to be able to pass a parameter something like this:
Describe alternatives you've considered
Currently thinking to pass
my token
usingtempToken
parameter, but I'm not sure about this solution. As I've seenTemp Token
generated from the Agora dashboard has a longer expiry time (around 1 day). butmy token
generated from my API Endpoint has only 5 minutes of expiry time.Additional context
I'm using
Agora UIKit Flutter: 1.3.6
agora-token-service: 1.4.2 ( using this Docker Image: https://hub.docker.com/r/iamriajul/agora-token-service )
Thanks.
The text was updated successfully, but these errors were encountered: