simpleidserver / SimpleIdServer

OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
https://simpleidserver.com/
Apache License 2.0
737 stars 99 forks source link

5002 GetAccessToken method, request token #806

Closed qq1176914912 closed 2 weeks ago

qq1176914912 commented 2 weeks ago

I found 5002 GetAccessToken method, request token, assuming that the first time I open a browser to https://localhost:5002/test, access is the test realm, rather than the master, But the realm for this method is still master and not test. Is that a problem? Is this normal? image

qq1176914912 commented 2 weeks ago

I started this problem because, I created another realm, I tried to delete the master, but I got an error getting the token, and then I tried to restart the project, when the project re-added the master realm to the database, it got an error getting the token, saying that the specified client name could not be found. I then added the client name to the master realm in the data, and now I get an error: { "error": "invalid_request", "error_description": "no JWK with algorithm RS256 has been found to sign the JWT" } I do not know where to continue to modify here

qq1176914912 commented 2 weeks ago

I modified the database RealmSerializedFileKey to configure the contents of the SerializedFileKey to the master realm, but now I have a problem, after I create a new realm, no new contents are added to the RealmUser table. The errors in these columns are caused by deleting the master realm

simpleidserver commented 2 weeks ago

The remove realm feature has been implemented in the release503 branch, and the following modifications have also been made:

qq1176914912 commented 2 weeks ago

I modified the database RealmSerializedFileKey to configure the contents of the SerializedFileKey to the master realm, but now I have a problem, after I create a new realm, no new contents are added to the RealmUser table. The errors in these columns are caused by deleting the master realm

What I want to do now is see how I can fix my deletion of the master from the library, because I don't want to recreate the library right now. After deleting mater, restarting the project and automatically adding a master, I found that when I added a realm in another realm, the return value of this realm was 0, so the user did not add to the new realm, I looked at the idea here is still to query the master realm, it should be caused by this reason image

qq1176914912 commented 2 weeks ago

Are email, SMS, etc. in authmethods shared? I'm not updating this configuration in the master realm now because I deleted the master from the realm and remember I configured this information in a realm called test and then created a new realm and the authmethods configuration in test was not synchronized to the new realm, Did you check only master here?

qq1176914912 commented 2 weeks ago

For the above two new problems, I did not download your latest release503 for testing. If your latest release503 has been modified, you can directly close these two problems.

simpleidserver commented 2 weeks ago

Hello,

Firstly, the default master realm should never be removed, as this realm is used by default when the IsRealmEnabled property in the appsettings.json file is set to false.

The code in the RealmsController is correct, as it assumes the master realm is always present.

Could you try restarting the application and check if the SeedData function in Program.cs recreates the missing master realm? If it still doesn't work, you may manually execute some SQL statements to re-insert the required data.

qq1176914912 commented 2 weeks ago

Hello,

Firstly, the default master realm should never be removed, as this realm is used by default when the IsRealmEnabled property in the appsettings.json file is set to false.

The code in the RealmsController is correct, as it assumes the master realm is always present.

Could you try restarting the application and check if the SeedData function in Program.cs recreates the missing master realm? If it still doesn't work, you may manually execute some SQL statements to re-insert the required data.

Ok, I see. Thank you for your reply