Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flushall_fast_build_and_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ if [ $BUILD_EXIT_CODE -ne 0 ] && [ -z "$DO_CLEAN" ]; then

# Check if error is related to missing classes/packages (common cache issue)
if grep -q "is not a member of package\|cannot find symbol\|not found: type\|not found: value" fast_build.log; then
echo "🔄 Detected incremental compilation cache issue. Retrying with clean build..."
echo "Detected incremental compilation cache issue. Retrying with clean build..."
echo ""

# Backup the failed incremental build log
Expand Down Expand Up @@ -284,7 +284,7 @@ fi
# Final error check
if [ $BUILD_EXIT_CODE -ne 0 ]; then
echo ""
echo "Build failed! Please check fast_build.log for details."
echo "Build failed! Please check fast_build.log for details."
echo "Last 30 lines of build log:"
tail -30 fast_build.log
exit 1
Expand Down
2 changes: 1 addition & 1 deletion obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8719,7 +8719,7 @@ trait APIMethods600 {
}
// Validate credentials using the existing AuthUser mechanism
resourceUserIdBox = //we first try to get the userId from local, if not find, we try to get it from external
code.model.dataAccess.AuthUser.getResourceUserId(postedData.username, postedData.password)
code.model.dataAccess.AuthUser.getResourceUserId(postedData.username, postedData.password, postedData.provider)
.or(code.model.dataAccess.AuthUser.externalUserHelper(postedData.username, postedData.password).map(_.user.get))
// Check if account is locked
_ <- Helper.booleanToFuture(UsernameHasBeenLocked, 401, callContext) {
Expand Down
4 changes: 2 additions & 2 deletions obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,8 @@ import net.liftweb.util.Helpers._



def getResourceUserId(username: String, password: String): Box[Long] = {
findAuthUserByUsernameLocallyLegacy(username) match {
def getResourceUserId(username: String, password: String, provider: String = Constant.localIdentityProvider): Box[Long] = {
findAuthUserByUsernameAndProvider(username, provider) match {
// We have a user from the local provider.
case Full(user) if (user.getProvider() == Constant.localIdentityProvider) =>
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,31 +178,6 @@ class VerifyUserCredentialsTest extends V600ServerSetup with DefaultUsers {
response.body.extract[ErrorMessage].message should include("OBP-20004")
}

scenario("Successfully verify with empty provider (provider check is optional)", ApiEndpoint, VersionOfApi) {
// Add the required entitlement
val addedEntitlement = Entitlement.entitlement.vend.addEntitlement("", resourceUser1.userId, CanVerifyUserCredentials.toString)

When("We verify valid credentials with empty provider")
val postJson = Map(
"username" -> testUsername,
"password" -> testPassword,
"provider" -> ""
)
val request = (v6_0_0_Request / "users" / "verify-credentials").POST <@ (user1)
val response = try {
makePostRequest(request, write(postJson))
} finally {
// Clean up entitlement
Entitlement.entitlement.vend.deleteEntitlement(addedEntitlement)
}

Then("We should get a 200 (provider check is skipped when empty)")
response.code should equal(200)

And("The response should contain user details")
(response.body \ "username").extract[String] should equal(testUsername)
}

scenario("Fail to verify with mismatched provider", ApiEndpoint, VersionOfApi) {
// Add the required entitlement
val addedEntitlement = Entitlement.entitlement.vend.addEntitlement("", resourceUser1.userId, CanVerifyUserCredentials.toString)
Expand Down