Why jx install runs chrome to get the admin token? - jenkins-x

When I run jx install I get those error messages
Attempting to find the Jenkins API Token with the browser in headless mode...using url http://jenkins.jx.35.205.149.20.nip.io/me/configure
unable to automatically find API token with chromedp using URL http://jenkins.jx.35.205.149.20.nip.io/me/configure
retrying after error:Running in batch mode and no default api token found
Unfortunatly, I'm running those install script from an Ansible docker container. As a consequence, I have no chrome installed in container (neither do I have an X environment and window manager).
So why is this token retrieved ? And is there a way to set it "by hand" (through another jx command, as an example) ?

there’s currently no other way with Jenkins to get an API token until we move to ephemeral / one shot masters rather than static masters.
We could disable the use of Chrome though? If it cannot use Chrome to get the API token the code asks you to visit the URL and copy/paste the api token from the Jenkins console

Related

Katalon browser authentication on Mac

Im trying to automate a site (using Katalon) that uses browser authentication on a Mac.
I can see that Windows users can use the Authenticate keyword, but is there a similar keyword or setting / configuration option for Mac users?
A way i was able to solve this was by adding credentials via the url as seen in Can you pass user/pass for HTTP Basic Authentication in URL parameters?
Changing the url to the following format solved the problem:
WebUI.navigateToUrl('https://username:password#example.com/')

How to use chrome with Windows authentication?

I am trying to perform HTTP get & put operations on a intranet URL which is authenticated using Microsoft active directory domain accounts. This is working fine with IE but not using chrome. My chrome version is 49.0.2623.108.
Accessing the URL throws up a dialog for username and password and upon filling details, it fails with ERR_INVALID_HANDLE. Following are the things that I tried and failed(Please excuse for the lack of brevity):
I tried adding the URL and the Active directory server to Local intranet zones but still chrome returns the same error.
This link https://serverfault.com/questions/19914/google-chrome-passthrough-windows-authentication says we need to use authserverwhitelist for chrome. It is not working. Apparently, this feature of setting parameters has been moved from commandline to policy settings as per https://bugs.chromium.org/p/chromium/issues/detail?id=472145
I tried using policy settings like using chrome policy template. I imported the policy template on local computer policies\Administrative templates in gpedit.msc and set the parameters AuthServerWhitelist and AuthNegotiateDelegateWhitelist. I restarted the machine as well. It didnt help. Chrome still throws the same error.
I tried setting AuthserverWhitelist and AuthNegotiateDelegateWhitelist parameters on registry as well under path: HKLM\Software\Policies\Google\Chrome.
Is there a way to get this working on google chrome(version 49.0.2623.108)?
PS: Also after development, I am looking to package these web pages into a chrome app. Would chrome allow usage of windows active directory authentication in its app environment? Is there any way to fix it?

Unable to find the maintenance token for TeamCity in the server log

I installed TeamCity on Windows Server 2012. It has been working fine setting up a few builds. I then attempted to install some plugins by putting .zip files in the ~/.BuildServer/plugins folder. I restarted the server by cd'ing to c:\TeamCity\bin and running "runAll stop" followed by "runAll start".
Then when I go to the teamcity page for several minutes I get a "Enter the maintenance authentication token" page. It says on the page to find the maintenance token in the teamcity-server.log file (see screenshot below). I look in c:\TeamCity\logs\teamcity-server.log and it has several "super user token" and "agent authorizationtoken". I tried using these token but get an invalid maintenance token error.
So my question is where do I find the maintenance token?
Edit: This has resolved itself for me since upgrading to the latest TeamCity version. None of the suggested answers worked at the time I had this problem so that's why I am not marking anything as the accepted answer.
Please check out file teamcity-winservice.log in logs subfolder of your Teamcity.
Auth token should be here.
open cmd goto TeamCity instalation folder
C:\TeamCity\bin
type
runAll.bat stop
wait until services stoped then type
runAll.bat start
u will see current authentication token in console,.
It should be in the file teamcity-server.log which is in the logs subfolder of your TeamCity installation - look for the text "Administrator login is required from web UI using authentication token" and a long number afterwards which is your token.
Also see the docs for TeamCity Maintenance Mode.
Had the same issue it is the Superuser token you want (it will be the last line in the log unless you have tried to login - which will show in here as failures)
Along the lines of
Administrator can login from web UI using authentication token: 1234567890
/Edited so line in log file is more obviously a quote and added an example token thanks #Kleopatra,
Took me a while to find it, but it's in the file as indicated, but it's the very last line.
if you are hitting on this issue https://youtrack.jetbrains.com/issue/TW-43100 in TeamCity (v10.0.4) for IE, you may need to enable javascript and also add the url to IE trusted site list.
If you cannot find in the log, just type a random value. The web ui will inform you that entered an invalid token.
Afterwards go to the log (TeamCity/logs/teamcity-server.log) and check the last line:
[2018-03-27 17:55:20,258] WARN - jetbrains.buildServer.STARTUP - Failed maintenance authentication from IP address /86.234.23.62 with token: "6056431478480274143". Current authentication token: "6418830881320521552"
I tried restarting the Teamcity service.
I tried the runAll stop start thing.
Didn't work for me.
I rebooted then found the superuser token in TeamCity/logs/teamcity-server.log
You will find multiple super user authentication token in the file specified (TeamCity\logs\teamcity-server). You can always use the last one in the file. (if there is not one in the last line, try logon with random number, you can get an authorization failed message with the token number included and it will be added to the file)

Error: invalid_client no registered origin

I have installed the Google Drive Realtime API sample files on my web server, following these instructions, including generating a client_id in the Cloud Console and inserting it into the index.html file.
When I visit that page and click the button to authorize the app, it pops up with a new window and shows:
Error: invalid_client
no registered origin
The Request Details are:
openid_connect_request=true
cookie_policy_enforce=false
scope=https://www.googleapis.com/auth/drive.install https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/plus.me
response_type=token
access_type=online
redirect_uri=postmessage
proxy=oauth2relay865404532
origin=http://mywebsite.com
state=264939258|0.165356673
display=page
client_id=1077585001321.apps.googleusercontent.com
authuser=0
I can't see any other client_id that I should be using in the Cloud Console. Does anybody know how to overcome this error? Thanks for your help.
In the new Google API Console, configure your OAuth2.0 authorized origins from
Your Project > APIs & auth > Credentials
You might need to add a new Client ID specifically for a web application (I did because the default was for AppEngine)
Create Client ID > Web Application > Authorized Javascript origins
If you are running on a local dev server, just add the exact URL such as :
http://127.0.0.1:9000
UPDATE: I changed accepted answer to Johno Scott instead as he refers to the newer version of the console, whereas mine was only true for the older version.
I solved it. I needed to enter a WEB ORIGIN on the OAuth 2.0 Client ID screen. Specifically, it had to be the exact path/url of the index.html file, otherwise it defaults to the root domain which doesn't work.
This screenshot shows you exactly where it needs to be entered:

Can we handle OS pop-up using "gem sikuli" in selenium script

When I hit url in browser it gives windows authentication pop-up and we need to enter proper username and password into that then only it will give home page of that site.
It is not able to handle windows pop-up using Selenium-WebDriver
I was trying to handle that pop-up using gem sikuli code inside selenium script but it is giving error as
Timeout::Error: execution expired
OS pop ups cannot be handled using Selenium Web Driver , however there are numerous other frameworks that can handle it. This is for a upload window , thus should work for your scenario too.
This is what I use in C#
driver.get("http://LOGIN:PASSWORD#localhost:8080/myApp/")
LOGIN> -> username which you need pass for authentication
PASSWORD> -> password which you need pass for authentication
After # put your URL.
Don't forget to put / at the end of the URL, At-least for firefox.

Resources