mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:17:35 +00:00
feat(api): add generic oauth provider template (#5260)
adds functionality to manage templates based OIDC IDPs
This commit is contained in:
@@ -1248,6 +1248,30 @@ service AdminService {
|
||||
};
|
||||
}
|
||||
|
||||
// Add a new OAuth2 identity provider on the instance
|
||||
rpc AddGenericOAuthProvider(AddGenericOAuthProviderRequest) returns (AddGenericOAuthProviderResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/idps/oauth"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
// Change an existing OAuth2 identity provider on the instance
|
||||
rpc UpdateGenericOAuthProvider(UpdateGenericOAuthProviderRequest) returns (UpdateGenericOAuthProviderResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/idps/oauth/{id}"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
// Add a new Google identity provider on the instance
|
||||
rpc AddGoogleProvider(AddGoogleProviderRequest) returns (AddGoogleProviderResponse) {
|
||||
option (google.api.http) = {
|
||||
@@ -4259,6 +4283,39 @@ message GetProviderByIDResponse {
|
||||
zitadel.idp.v1.Provider idp = 1;
|
||||
}
|
||||
|
||||
message AddGenericOAuthProviderRequest {
|
||||
string name = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string client_id = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string client_secret = 3 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string authorization_endpoint = 4 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string token_endpoint = 5 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string user_endpoint = 6 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
repeated string scopes = 7 [(validate.rules).repeated = {max_items: 20, items: {string: {min_len: 1, max_len: 100}}}];
|
||||
zitadel.idp.v1.Options provider_options = 8;
|
||||
}
|
||||
|
||||
message AddGenericOAuthProviderResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
string id = 2;
|
||||
}
|
||||
|
||||
message UpdateGenericOAuthProviderRequest {
|
||||
string id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string name = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string client_id = 3 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
// client_secret will only be updated if provided
|
||||
string client_secret = 4 [(validate.rules).string = {max_len: 200}];
|
||||
string authorization_endpoint = 5 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string token_endpoint = 6 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string user_endpoint = 7 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
repeated string scopes = 8 [(validate.rules).repeated = {max_items: 20, items: {string: {min_len: 1, max_len: 100}}}];
|
||||
zitadel.idp.v1.Options provider_options = 9;
|
||||
}
|
||||
|
||||
message UpdateGenericOAuthProviderResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
message AddGoogleProviderRequest {
|
||||
// Google will be used as default, if no name is provided
|
||||
string name = 1 [(validate.rules).string = {max_len: 200}];
|
||||
|
@@ -263,8 +263,16 @@ message ProviderConfig {
|
||||
oneof config {
|
||||
LDAPConfig ldap = 2;
|
||||
GoogleConfig google = 3;
|
||||
OAuthConfig oauth = 4;
|
||||
}
|
||||
}
|
||||
message OAuthConfig {
|
||||
string client_id = 1;
|
||||
string authorization_endpoint = 2;
|
||||
string token_endpoint = 3;
|
||||
string user_endpoint = 4;
|
||||
repeated string scopes = 5;
|
||||
}
|
||||
|
||||
message GoogleConfig {
|
||||
string client_id = 1;
|
||||
|
@@ -4369,6 +4369,29 @@ service ManagementService {
|
||||
};
|
||||
}
|
||||
|
||||
// Add a new OAuth2 identity provider in the organisation
|
||||
rpc AddGenericOAuthProvider(AddGenericOAuthProviderRequest) returns (AddGenericOAuthProviderResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/idps/oauth"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "org.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
// Change an existing OAuth2 identity provider in the organisation
|
||||
rpc UpdateGenericOAuthProvider(UpdateGenericOAuthProviderRequest) returns (UpdateGenericOAuthProviderResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/idps/oauth/{id}"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "org.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
// Add a new Google identity provider in the organisation
|
||||
rpc AddGoogleProvider(AddGoogleProviderRequest) returns (AddGoogleProviderResponse) {
|
||||
@@ -7874,6 +7897,39 @@ message GetProviderByIDResponse {
|
||||
zitadel.idp.v1.Provider idp = 1;
|
||||
}
|
||||
|
||||
message AddGenericOAuthProviderRequest {
|
||||
string name = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string client_id = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string client_secret = 3 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string authorization_endpoint = 4 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string token_endpoint = 5 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string user_endpoint = 6 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
repeated string scopes = 7 [(validate.rules).repeated = {max_items: 20, items: {string: {min_len: 1, max_len: 100}}}];
|
||||
zitadel.idp.v1.Options provider_options = 8;
|
||||
}
|
||||
|
||||
message AddGenericOAuthProviderResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
string id = 2;
|
||||
}
|
||||
|
||||
message UpdateGenericOAuthProviderRequest {
|
||||
string id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string name = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string client_id = 3 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
// client_secret will only be updated if provided
|
||||
string client_secret = 4 [(validate.rules).string = {max_len: 200}];
|
||||
string authorization_endpoint = 5 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string token_endpoint = 6 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string user_endpoint = 7 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
repeated string scopes = 8 [(validate.rules).repeated = {max_items: 20, items: {string: {min_len: 1, max_len: 100}}}];
|
||||
zitadel.idp.v1.Options provider_options = 9;
|
||||
}
|
||||
|
||||
message UpdateGenericOAuthProviderResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
message AddGoogleProviderRequest {
|
||||
// Google will be used as default, if no name is provided
|
||||
string name = 1 [(validate.rules).string = {max_len: 200}];
|
||||
|
Reference in New Issue
Block a user