How to use the same super admin in WSO2 AM docker - wso2

I changed the datasource from H2 to MSSQL, and WSO2 AM created the admin user. I created the endpoints, but when I restart the container (because I changed the port), WSO2 AM is in blank, but the database has the information user, endpoint, etc. how can I use the same information of the database in WSO2 AM.
Thanks

"WSO2 AM is in blank, but the database has the information user, endpoint, etc. how can I use the same information of the database in WSO2 AM." : What do you mean by here? Once you changed the database (H2 -> MsSQL) can't you see any created APIs in the publisher or store UI? If it is, did you migrate the H2 data from MsSQL database(AM DB data, Registry DB data and UM dB data)? If you have migrated data, in order to see the API in Publisher and Store UI, you can do the reindexing as mentioned here(5th step)[1]
[1]. https://docs.wso2.com/display/AM260/Upgrading+from+the+Previous+Release#UpgradingfromthePreviousRelease-Step2-UpgradeWSO2API-M2.5.0to2.6.0

Related

Adding a user to WSO2 Identity Server

We're integrating our asp.net MVC client with WSO2's Identity Server v5.8.0.
Below are the steps we've followed:
1) Created a Service provider for our MVC application & configured Inbound authentication with OAuth/OpenID configuration, also configured Inbound provisioning with primary user store.
2) In our MVC application, we've set up a WSO2 configuration using OWIN's WSO2 NuGet package with the generated client-id & client-secret from the service provider.
3) We've configured MongoDB as our primary user store.
Now we're trying to add a user using SCIM2 API (https://localhost:9443/scim2/Users). Below is the response we're getting:
{"schemas":["urn:ietf:params:scim:api:messages:2.0:Error"],"detail":"Cannot add user through scim to user store . SCIM is not enabled for user store WSO2.COM","status":"500"}
I've even changed below config in user-mgt.xml
<Property name="SCIMEnabled">true</Property>
What else do we need to configure? Is there any other way to add user in WSO2 Identity server apart from using SCIM APIs?
It seems like you are having two user stores the primary user store and a secondary user store named wso2.com. By adding the
<Property name="SCIMEnabled">true</Property>
To the user-mgt.xml you are enabling SCIM2 to the primary user store. Not the secondary user store. But from the API you are adding the user to the secondary user store. Since you havent enabled SCIM in the secondary user store you are getting this error. You have two options.
1) Add the user to PRIMARY user store
By analyzing the error that you are getting the user name of the user that you are trying to add should be some thing like
WSO2.COM/Abhishek
Change this to
Abhishek
2) Enable SCIM2 in the secondary user store
Log in to the management console and click list in User Stores sub menu under identity menu.
The User Store Management page opens. There should be a user store named WSO2.COM
Click on edit. Click on advanced tick the enable scim
Reference: https://docs.wso2.com/display/IS580/Using+the+SCIM+2.0+REST+APIs

API Publisher and Store not displaying API

My wso2registry was pointing to wso2carbon datasource which was configured with h2 db. Other db were configured with mysql. I was getting errors that there are some locks on h2 db and my wso2 server was not starting up .I changed the wso2carbon to point to mysql regdb endpoint. The server started after that. Now the api created earlier in the publisher console are not visible. The api are also not showing up in the store even though the store says that it is listing some 18 apis. If i create the apis again I get a duplicate error.
I tried to point the wso2carbon datasource back to the same h2 db but still the publisher and store apis do not come up.
Is there a way I can clean up the apis so that I can recreate them with regdb configured with mysql db
To see your APIs with H2 database again, reindex the registry.
Change the <lastAccessTimeLocation> element in the <APIM_HOME>/repository/conf/registry.xml file in the Store/Publisher node. For example, change the /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime registry path to /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime_1.
Restart the server. After a few seconds, it should re-index the APIs.

Why does WSO2 Identity Server retrieve tenant admin credential from a registry file not from a database?

I'm trying to create a self-signup client application which is using WSO2 API Manager and Identity Server.
When I tried to call a web service provided by Identity Server, I've observed that some of the java classes are trying to get a tenant admin credential from a registry file called self-signup.xml.
Due to this I am forced to change the tenant's admin credential manually in self-signup.xml whenever I change the admin's credential through carbon UI.
My questions are:
Is there any specific reason that WSO2 Identity Sever gets a tenant admin credential from that registry file rather than retrieving it from a database?
Is there any way to automatically update the tenant admin's credential written on that registry file when the credential is updated in the database (e.g. changed through carbon UI)
Thanks in advance.
What is the web service you are using for self sign up here?
If you are using UserRegistrationAdminService you should not require any admin credential for self sign up.
You should not require to read admin credentials from a file in your client. Usually if you want to call a web service which require authentication from your client, you need an user logged in to your client and you need to use the cookie retrieved by that user.

create a gadget in dashboard designer of DAS WSO2

I created a tenant in WSO2 DAS and I am authenticated with that tenant. I created a stream event, when I go to the dashboard designer and try to create a gadget I get the following error.
[2016-02-11 12:08:15,207] ERROR {org.wso2.carbon.analytics.jsservice.AnalyticsJSServiceConnector} - Failed to get the table schema for table: TT : [-1234:TT] does not exist org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsTableNotAvailableException: [-1234:TT] does not exist
This is the solution that worked for me.
Go to the file:
<DAS_HOME>/repository/deployment/server/jaggeryapps/portal/controllers/apis/analytics.jag
and change line 80 to:
loggedInUser = token[USERNAME]+"#"+token["domain"];
If you created the stream by logging using tenant credentials, you need to log into Analytic Dashboards using same tenant credentials. Streams created for one tenant is not available for other tenants. According to your screenshot you have been logged using admin credentials.
I have the same problem, I am using a tenant credentials to access the dashboard designer and when I try to create a gadget I get the same problem, if I do it with the super tenant I can create the gadget without problem.

Deploying WSPs to SP2013: I was not able to connect to the sql data even after deploying the WSPs properly

I developed a webapplication Example1:7575 which uses FBA. Now, I deployed these WSP's to a new server Production:2525 to get the same functionality of my previous server's webapplication. However, I was not able to fetch the data from sql server and I'm getting the following error: A Membership Provider has not been configured correctly. Check the web.config setttings for this web application.
Actually, I have manually entered the same membership and role providers of my previous server's central admin, security service token & web application's web.config entries to this new web.configs and matched them.
Can someone help me with where I might be doing wrong. Any help would be greatly appreciated.
If you can't fetch data from SQL Server there's probably an issue with permissions to the database. Check the database connection string that FBA is using. It likely uses Windows authentication to connect - in which case it will be connecting as the user assigned to the app pool for the web application and the secure token service. Check that the configured app pool identities have permissions to access the sql server databases.