-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Accept 'authorization_details' field in the authorization request. - Persist code and consent authorization details in the database. - Add support for oauth.rar and oauth.rar.common modules. - Read custom implementations of AuthorizationDetailsProvider from SPI. - Display rich authorization details in the consent UI.
- Loading branch information
1 parent
e4620e8
commit f9d06d5
Showing
36 changed files
with
2,802 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
components/org.wso2.carbon.identity.oauth.rar.common/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId> | ||
<artifactId>identity-inbound-auth-oauth</artifactId> | ||
<version>7.0.107-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>org.wso2.carbon.identity.oauth.rar.common</artifactId> | ||
<packaging>jar</packaging> | ||
<name>WSO2 Carbon - Rich Authorization Requests Common</name> | ||
<url>http://wso2.org</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.framework</groupId> | ||
<artifactId>org.wso2.carbon.identity.core</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<release>8</release> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.github.spotbugs</groupId> | ||
<artifactId>spotbugs-maven-plugin</artifactId> | ||
<configuration> | ||
<threshold>High</threshold> | ||
<maxHeap>2048</maxHeap> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
69 changes: 69 additions & 0 deletions
69
...src/main/java/org/wso2/carbon/identity/oauth2/rar/common/dao/AuthorizationDetailsDAO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 Inc. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.oauth2.rar.common.dao; | ||
|
||
import org.wso2.carbon.identity.oauth2.rar.common.dto.AuthorizationDetailsConsentDTO; | ||
import org.wso2.carbon.identity.oauth2.rar.common.model.AuthorizationDetails; | ||
|
||
import java.sql.SQLException; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* Provides methods to interact with the database to manage authorization details. | ||
*/ | ||
public interface AuthorizationDetailsDAO { | ||
|
||
/** | ||
* Adds authorization details against a given OAuth2 code. | ||
* | ||
* @param authorizationCodeID The ID of the authorization code. | ||
* @param authorizationDetails The authorization details to store. | ||
* @param tenantId The tenant ID. | ||
* @return An array of positive integers indicating the number of rows affected for each batch operation, | ||
* or negative integers if any of the batch operations fail. | ||
* @throws SQLException If a database access error occurs. | ||
*/ | ||
int[] addOAuth2CodeAuthorizationDetails(String authorizationCodeID, AuthorizationDetails authorizationDetails, | ||
int tenantId) throws SQLException; | ||
|
||
/** | ||
* Adds user consented authorization details. | ||
* | ||
* @param authorizationDetailsConsentDTOs List of user consented authorization details DTOs. | ||
* {@link AuthorizationDetailsConsentDTO } | ||
* @return An array of positive integers indicating the number of rows affected for each batch operation, | ||
* or negative integers if any of the batch operations fail. | ||
* @throws SQLException If a database access error occurs. | ||
*/ | ||
int[] addUserConsentedAuthorizationDetails(List<AuthorizationDetailsConsentDTO> authorizationDetailsConsentDTOs) | ||
throws SQLException; | ||
|
||
int deleteUserConsentedAuthorizationDetails(String consentId, int tenantId) | ||
throws SQLException; | ||
|
||
// add a todo and mention to move this to consent module | ||
String getConsentIdByUserIdAndAppId(String userId, String appId, int tenantId) throws SQLException; | ||
|
||
Set<AuthorizationDetailsConsentDTO> getUserConsentedAuthorizationDetails(String consentId, int tenantId) | ||
throws SQLException; | ||
|
||
int[] updateUserConsentedAuthorizationDetails(List<AuthorizationDetailsConsentDTO> authorizationDetailsConsentDTOs) | ||
throws SQLException; | ||
} |
Oops, something went wrong.