Skip to content
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

[Auth] Authorization failure when engaging empty scopes for HTTP service config #13325

Closed
ldclakmal opened this issue Jan 25, 2019 · 0 comments
Closed
Assignees
Labels
Team/StandardLibs All Ballerina standard libraries Type/Bug
Milestone

Comments

@ldclakmal
Copy link
Member

Description:
If the scopes of HTTP service config is defined as [] (empty scopes), there is no way to make the requests "Authorization Successfull".

@http:ServiceConfig {
    basePath: "/hello",
    authConfig: {
        authentication: { enabled: true },
        scopes: []
    }
}

Steps to reproduce:

sample.bal

import ballerina/http;

http:AuthProvider basicAuthProvider = {
    scheme: "basic",
    authStoreProvider: "config"
};

listener http:Listener ep = new(9090, config = {
    authProviders: [basicAuthProvider],
    secureSocket: {
        keyStore: {
            path: "${ballerina.home}/bre/security/ballerinaKeystore.p12",
            password: "ballerina"
        }
    }
});

@http:ServiceConfig {
    authConfig: {
        authentication: { enabled: true },
        scopes: []
    }
}
service hello on ep {
    resource function sayHello(http:Caller caller, http:Request req) {
        _ = caller->respond("Hello, World!!!");
    }
}

users.toml

["b7a.users"]
["b7a.users.tom"]
password="123"

Run the program - $ ballerina run -c users.toml sample.bal
Test the program - $ curl -k -u tom:123 https://localhost:9090/hello/sayHello

Expected output - Hello, World!!!
Actual output - Authorization failure

Affected Versions:
0.990.2

OS, DB, other environment details and versions:
Ubunut 16.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/StandardLibs All Ballerina standard libraries Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants