Cannot log in to smart apps toolkit sample - cumulocity

I am following the link below to test the smart apps toolkit,
https://www.cumulocity.com/guides/web/smart-toolkit/
I can reach the "5. Create login screen" and see the login page with GRUNT SERVER running in the background. However, I have no luck to login with my account. I got my trial account from telstra-iot.com and my homepage is m2mone.telstra-iot.com.
I change the "demos.cumulocity.com" in hello-core-api/js/app.js to "www.telstra-iot.com" and still no luck.
I put in tenant: m2mone, user name: admin, password: xxxxxx. Did I miss anything?

You need to use https://m2mone.telstra-iot.com/ as baseUrl:
c8yCumulocityProvider.setBaseUrl('https://m2mone.telstra-iot.com/');
You can also set tenant there so you don't need to fill tenant in login page:
c8yCumulocityProvider.setTenant('m2mone');
Now you can leave tenant field empty in login page and if you want, you can remove the tenant field from login page altogether.

By default the grunt server task leads to developer.cumulocity.com which will not work for you because you are on a different installation (telstra-iot).
You can define the host when executing the grunt task
grunt server --host=m2mone.telstra-iot.com

Related

Integration testing with Azure ADB2C

We have a Web application that is protected by Azure ADB2C. Users must be logged in to access the application. When the user logs into the application we use the API connectors feature to go and fetch more user details using the email the user logged in with. These extra details are added to the token as custom attributes and are consumed by the web app inside the OnTokenValidated event.
When our code is deployed to either the Test/Staging or Production endpoints our integration tests are run against that endpoint. I can't spoof the authentication as the tests are talking to live endpoints. I need to authenticate the tests as if they are a real user.
I have looked around and have tried the ROPC flow that is suggested on similar posts. The trouble is with this solution is that it does not call the API connectors to get the extra user details that the 'normal' login flow would.
ROPC Solution:
Integration Test with Azure AD login
How can I make my integration tests authenticate with Azure ADB2C the same way a real user would so that the API connectors are called?
Any help/advice is greatly appreciated.
Thanks.
Thanks you Nasheen Kalam for the blog.
Based on the GIT reference for Integration Test for the Sign up and Sign in Pages
https://git.uwaterloo.ca/jmshahen/ece651-project/-/merge_requests/22
Below are the process:
Run authentication test with pre-defined user
Test Step:
1.Go to application URL: 127.0.0.1:3000
2. Redirect to Sign In page
3. Use registered email and password
4. Sign In
5. Verify Result
Expected Result:
Pass: when email, password is matched
Fail: Error message thrown in case of wrong combination
Run sign up process for new user
Test Steps:
Manually Remove user if already exists in DB
1.Go to application URL: 127.0.0.1:3000/signup
2. Use full name, email address and password
4. Sign Up
5. Verify Result
Test Data
User name: Test User01
User email: testuser#gmail.com
User Password:
usertest01
Verification text:
Test User01
Expected Result:
Pass: when new user is created
Fail: Error message thrown in case of user already exists

'Camunda > Admin > Authorization' changes requires restart to take effect

I have created a spring-starter project with camunda 7.15.0. In addition for demo purposes, I configured and integrated Apache DS for users and groups. I am able to get users and groups.
Further, I removed the default group camunda-all and used AD groups from the screenshot. So,
HMS Victory was able to access only Cockpit
HMS Bounty was able to access only 'Tasklist'
HMS Lydia had no access to the system
This works too and gives expected result.
However, any change to 'Camunda > Admin > Authorization' requires restart to take effect. Otherwise the changes do not take effect. Any change required to make AD Group changes take effect at run time ? Below is my Groups configuration.
This seems to be application behavior. When you logout from Camunda Webapp, the URL does not go back to Welcome page. When I closed the browser tab, or used the default url http://localhost:8080 then it worked. For more details, use default url to login to Camunda

Using Azure Active Directory with aspnetcore app

I am trying to get up to speed using Azure Active Directory with an aspnetcore 5.0 web app.
I have followed this tutorial, and it seems to work fine: That is, I start the app, and it then shows the Active Directory Login, and I log in with my Microsoft Account.
I then try to view the app as a logout out user. So I log out. However, when I do so, I am directed back to the Active Directory login again. It seems there is no way to view the app unless I am logged in.
Instead, I would like to see the login prompt only when I click the Login link. And I should be able to view the app after logging out.
How do I do this?
One way is to use custom URL Rewriting Middleware to redirect by checking the Homepage path.
For Example, In app.UseMvc use below code:
app.UseRewriter(
new RewriteOptions().Add(
context => { if (context.HttpContext.Request.Path == "/AzureAD/Account/SignedOut")
{ context.HttpContext.Response.Redirect("/Home/Index"); }
})
);

Destroyed my LifeRay+CAS installation

I'm using LifeRay in version 6.1 in combination with CAS. For testing purposes, I wanted to deactivate CAS temporarily and use the native login functionality of LifeRay instead. Therefore, I deactivated CAS in the Portal Settings. Now, I cannot login myself in LifeRay, because even if I click on "sign in" I got "You do not have permission to view this page." Where can I activate CAS again in the config-files or database OR how can I return to the native login functionality of LifeRay? Thank you!
Add the following in your portal-ext.properties(You can also create property hook, but since this is temporary, i would recommend you to change this for the moment do the clean up and then remove the property) and restart the server
auto.login.hooks=com.liferay.portal.security.auth.CASAutoLogin,com.liferay.portal.security.auth.FacebookAutoLogin,com.liferay.portal.security.auth.NtlmAutoLogin,com.liferay.portal.security.auth.OpenIdAutoLogin,com.liferay.portal.security.auth.OpenSSOAutoLogin,com.liferay.portal.security.auth.RememberMeAutoLogin,com.liferay.portal.security.auth.SiteMinderAutoLogin,com.liferay.portal.security.auth.ParameterAutoLogin
Once server is restarted add the following parameters to any of liferay's url
?parameterAutoLoginLogin=test#liferay.com&parameterAutoLoginPassword=test
Change credentials to your admin credentials

Command Line Authentication in Web2py

I have made a web interface for my project using web2py and configured login with pam. Now i have to make a CLI for the same. I could not find any way i can authenticate the user (we can assume that the user i want to authenticate is already logged in on the linux machine configured with pam and running web2py).
First you need to find out the name of the logged in user:
username = os.getlogin()
Then you force a login:
from gluon.storage import Storage
from uuid import uuid4
session.auth = Storage(user=user, last_visit=request.now,
expiration=auth.settings.expiration,
hmac_key = str(uuid4())
we are about to add a auth method to do this in one line.
To add to what Massimo said, this one-line login has been implemented now. You can do so using the following code:
#User_id is whatever the id is for the user you are forcing them to log in to
auth.login_user(user_id)
I couldn't find any documentation on this in the book but you can take a look at the method yourself in the gluon.tools module in the source.