question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

run authentication example as part of CI

See original GitHub issue

Trying to log in to the server via wampcra on the wamp server, when attempting to authorize in the log error:### Left reason = wamp.error.authorization _ failed, message = invalid password, though via autobahn-python everything works fine, password correct. Here is my authorization code:

Session session = new Session ();
 IAuthenticator authenticator = new ChallengeResponseAuth(authid, secret);
Client client = new Client(session, url, realm, authenticator);
CompletableFuture<ExitInfo> exitInfoCompletableFuture = client.connect();

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
om26ercommented, Oct 18, 2019

Works for me, here is the code that I used in android to test

    private void testAuth() {
        exampleCRA("ws://192.168.1.236:8080/ws", "realm1", "joe", "secret2");
    }

    private static CompletableFuture<ExitInfo> connect(
            String websocketURL, String realm, IAuthenticator authenticator) {
        Session wampSession = new Session();
        wampSession.addOnJoinListener((session, details) -> System.out.println("Joined session."));
        Client client = new Client(wampSession, websocketURL, realm, authenticator);
        return client.connect();
    }

    public static CompletableFuture<ExitInfo> exampleCRA(
            String websocketURL, String realm, String authid, String secret) {
        return connect(websocketURL, realm, new ChallengeResponseAuth(authid, secret));
    }

And here is the config

{
    "$schema": "https://raw.githubusercontent.com/crossbario/crossbar/master/crossbar.json",
    "version": 2,
    "controller": {
    },
    "workers": [
        {
            "type": "router",
            "realms": [
                {
                    "name": "realm1",
                    "roles": [
                        {
                            "name": "frontend",
                            "permissions": [
                                {
                                    "uri": "",
                                    "match": "prefix",
                                    "allow": {
                                        "call": true,
                                        "register": true,
                                        "publish": true,
                                        "subscribe": true
                                    },
                                    "disclose": {
                                        "caller": false,
                                        "publisher": false
                                    },
                                    "cache": true
                                }
                            ]
                        }
                    ]
                }
            ],
            "transports": [
                {
                    "type": "web",
                    "endpoint": {
                        "type": "tcp",
                        "port": 8080
                    },
                    "paths": {
                        "ws": {
                            "type": "websocket",
                            "auth": {
                                "wampcra": {
                                    "type": "static",
                                    "users": {
                                        "joe": {
                                            "secret": "secret2",
                                            "role": "frontend"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            ]
        }
    ]
}
1reaction
oberstetcommented, Oct 18, 2019

@om26er to cut down in time spent, we should add https://github.com/crossbario/autobahn-java/blob/master/demo-gallery/src/main/java/io/crossbar/autobahn/demogallery/AuthenticationExampleClient.java to the CI tests automatically run

that is, test (from ABJ under netty) that all 3 auth methods do work: WAMP-CRA, WAMP-Cryptosign, WAMP-Ticket against the CB started as part of the CI.

essentially extend CI so these auth tests can be looked at as part of the travis log https://travis-ci.org/crossbario/autobahn-java

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitLab CI/CD job token
When a pipeline job is about to run, GitLab generates a unique token and injects it as the CI_JOB_TOKEN predefined variable. You can...
Read more >
Secure CI/CD Pipelines: Best Practices for Managing CI/CD ...
Typically, an authenticator certifies that the client run-time container attributes of the requesting container match the native characteristics ...
Read more >
Authenticating pipelines using git secret
In the following example, Pipelines uses a basic-auth secret, which relies on a username and password, to access repositories at github.com and gitlab.com...
Read more >
How to use a service account for CI deployments #225 - GitHub
Running clasp login sets up a .clasprc file with a token that seems to ... Say I store a token and refresh token...
Read more >
End user authentication for Cloud Run tutorial
Understanding the core code. The sample is implemented as client and server, as described next. Integrating with Identity Platform: client-side code.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found