2020-07-14 14:32:47 -07:00
syntax = "proto3" ;
package controller.api.services.v1 ;
2020-08-10 17:15:02 -04:00
option go_package = "github.com/hashicorp/boundary/internal/gen/controller/api/services;services" ;
2020-07-14 14:32:47 -07:00
2020-07-23 11:26:15 -07:00
import "protoc-gen-openapiv2/options/annotations.proto" ;
2020-07-14 14:32:47 -07:00
import "google/api/annotations.proto" ;
import "google/protobuf/struct.proto" ;
import "controller/api/resources/authtokens/v1/authtoken.proto" ;
2020-09-29 13:17:59 -07:00
option ( grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger ) = {
info : {
title : "Controller API"
}
schemes : HTTPS
schemes : HTTP
};
2020-07-14 14:32:47 -07:00
service AuthenticationService {
2020-09-26 08:30:27 -04:00
// Authenticate validates credentials provided and returns an Auth Token.
2020-07-14 14:32:47 -07:00
rpc Authenticate ( AuthenticateRequest ) returns ( AuthenticateResponse ) {
option ( google.api.http ) = {
2020-09-08 13:27:51 -07:00
post : "/v1/auth-methods/{auth_method_id}:authenticate"
2020-07-14 14:32:47 -07:00
body : "*"
response_body : "item"
};
2020-07-23 11:26:15 -07:00
option ( grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
2020-07-22 00:14:28 -04:00
summary : "Authenticate a user to an scope and retrieve an authentication token."
2020-07-14 14:32:47 -07:00
};
}
}
2020-09-26 08:30:27 -04:00
// The layout of the struct for "credentials" field in AuthenticateRequest. This message isn't directly referenced anywhere but is used here to define the expected field names and types.
2020-07-14 14:32:47 -07:00
message PasswordCredentials {
2020-09-26 08:30:27 -04:00
string login_name = 1 [ json_name = "login_name" ];
2020-07-14 14:32:47 -07:00
string password = 2 ;
}
message AuthenticateRequest {
2020-09-26 08:30:27 -04:00
// The ID of the Auth Method in the system that should be used for authentication.
string auth_method_id = 1 [ json_name = "auth_method_id" ];
// This can be "cookie" or "token". If not provided, "token" will be used. "cookie" activates a split-cookie method where the token is split partially between http-only and regular cookies in order to keep it safe from rogue JS in the browser.
string token_type = 2 [ json_name = "token_type" ];
// Credentials are passed to the Auth Method; the valid keys and values depend on the type of Auth Method.
2020-07-22 00:14:28 -04:00
google.protobuf.Struct credentials = 3 ;
2020-07-14 14:32:47 -07:00
}
message AuthenticateResponse {
resources.authtokens.v1.AuthToken item = 1 ;
2020-09-26 08:30:27 -04:00
string token_type = 2 [ json_name = "token_type" ];
}