Web Application not visible in Artifactory after deployment. Asks for login credentials - maven

I have deployed a very basic web app to JFrog that I created using Maven. It has a basic JSP file that says "Hello World" I deployed a .war file manually. After deployment, I was able to see the link like
localhost:8082/artifactory/MyWebApp/
But, when I hit it, it redirects me to 8082 and asks for a username and password which I never set up. I tried the login name and password but this does not seem to work. I have not used any authentication in my application. Kindly help

So, I resolved it. As it was a new installation, I generated a new token and gave it permission to access. I was thus able to access the path and download the artifact.

This seems to be a permission issue to me. Generate a new token with proper access. Should work.

Related

Download GitLab Generic Package File using Deploy Token

I have a project (A), with CI pipeline, in GitLab. This pipeline has a dependency on a package from another project (B). During the build of project A, I want to download the package from project B's package registry. The packages are uploaded as (zip files) generic packages. The projects are all private so I need some kind of access token to authenticate.
I'm trying to use Deploy Tokens as these seem to provide the required read_package_registry access scope. However, I cannot find any documentation describing how to authenticate with a deploy token when downloading generic package files.
I'm using the following request, described in the previous link.
GET https://gitlab.com/api/v4/projects/<project_B_id>/packages/generic/<package_name>/<package_version>/<package_file>
I have tried
adding the deploy token username and password to the URL, basic/digest authentication
Adding a header to the request PRIVATE-TOKEN: [deploy-token]
Adding a header to the request DEPLOY-TOKEN: [deploy-token]
Adding a header to the request Authorization: Bearer [deploy-token]
I've also tried each of the above headers but with [deploy-token-username][deploy-token] as the value
I can't find documentation stating that I can't use a deploy token.
Does anyone have a working example of how to do this, or does anyone know if this is/isn't possible?
I can switch to a private access token, but I'd prefer to use the correct tool for the job, and that seems to be deploy tokens.
The issue has been raised on gitlab. Deploy tokens do not work for now. It is currently tracked here:
https://gitlab.com/gitlab-org/gitlab/-/issues/284397
The workaround is to use a personal access token.
This works since Gitlab 13.0. As per documentation, create a deploy token, and supply the username and password in the request. This is basic authentication, and with curl you can do so
curl --user "<deploy-token-username>:<deploy-token>" \
"https://gitlab.example.com/api/v4/projects/24/packages/generic/my_package/0.0.1/file.txt"
Deploy tokens do not seem to work with PRIVATE-TOKEN or Authorization headers with bearer token.
I've been looking for this answer too.
The docs (https://docs.gitlab.com/ee/user/packages/generic_packages/index.html#authenticate-to-the-package-registry) say
To authenticate to the Package Registry, you need either a personal access token or CI job token.
No mention of Deploy Tokens. Those seem to be limited to docker, npm, etc.
Also, the Job Token you have in project B allows you to publish your artifact. But, the Job Token you have in project A does not seem to be authorized to download it.
I believe the answer is that you cannot use a Deploy Token, but I'd love to be proven wrong.

Spring Cloud Config Server - Connect to Github account with 2FA

I'm trying to create a Spring Cloud Config Server to retrieve configuration files from a private GitHub repository. My GitHub account has 2 Factor Authentication activated so I wasn't expecting the below configuration to work, which it didn't but I can't find any documentation to suggest what I need to do in order to make it work.
What configuration do I need to set that will allow the connection to work?
spring.cloud.config.server.git.uri=https://github.com/DanBonehill/photo-app-config
spring.cloud.config.server.git.username=USERNAME
spring.cloud.config.server.git.password=PASSWORD
Error
org.eclipse.jgit.api.errors.TransportException: https://github.com/DanBonehill/photo-app-config: not authorized
What you could try and do (have not tested this), is create a personal access token from the Github console.
Then configure
spring.cloud.config.server.git.username=<yourusername>
spring.cloud.config.server.git.password=<yourtoken>
Instead of using username and password you should use an ssh key, the official documentation can guide you through it!
Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.
you solve this in 2 minutes, this problem is because at August 13, 2021 the github update the login form, to solve this.
1) login in your gitHub folow this path: Settings > Developer settings > Personal access tokens > Generate new token
2) Now set a long time to expiration token, check the "repo" to allow access repository with this token, and Generate token.
3) Now skill your github password because this token created is your new password, replace this at all application, server, terminal that need to access github.
4) Now configure your spring configuration server, this is a content of file "application.properties" of spring configuration server at path /src/main/resources/application.properties.
spring.cloud.config.server.git.uri= https://github.com/"username"/"repository" //your githur repository
spring.cloud.config.server.git.search-paths= myFilesFolder /if your files is into some folder
spring.cloud.config.server.git.username= testUsername // your username
spring.cloud.config.server.git.password= gti_FdsweecSoUSHPsdfw //Here is your new token created

Unable to deploy service to PCF with no-route

I have this strange issue while pushing one of my application to PCF.
I wants to implement blue-green deployment for my service and I want to deploy app-v2 version with no-route and then add temp route after deployment done.
because I need to bind one marketplace service UAA Single Sign-on(Provides identity capabilities via UAA as a Service) service at application startup time.
This UAA service is causing issue while pushing.
cf command using for deployment
cf push -f manifest-dev.yml --no-route
Error screenshot:
PCF version 2.x
I have a couple ideas that might help to get around this.
Don't use --no-route. You said I want to deploy app-v2 version with no-route and then add temp route after deployment done, so just skip the --no-route part and put the temp route directly into your manifest-dev.yml file. If you already have a route in that file, you could make a copy and call it manifest-dev-v2.yml and put the route there.
Split this up. Remove your service from the manifest-dev.yml file. Run cf push -f manifest-dev.yml --no-route --no-start. Then map the temp route. Then bind the service. Then run cf start. You could alternatively drop the manifest all together, and just script your cf cli actions in a shell script or something like that.
You could look at using one of the blue/green plugins for the cf cli. There's a few and I can't recommend one over another. You can see them all here (search for blue/green).
http://plugins.cloudfoundry.org/
For a little background on the error that's being reported, the authorization code grant (Oauth2) cannot work without a redirect URL. For this flow, a user get's redirected to the login page and then get's redirected back to your redirect URL once login has occurred. Without that redirect URL, users can't complete the flow. It appears to be failing since you don't have any routes and thus cannot have a redirect URL.
Hope that helps!

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:

MVC Application endpoint Authentication Required for subdomain

I have a c#.net MVC3 application running on Windows Server 2008 R2 Datacenter.
If I deploy the application as an application under the main site (i.e. www.mysite.com/crm) it works perfectly.
If I deploy the application as a sub-domain to the main site (i.e. crm.mysite.com) it appears to work as expected, with the exception of one endpoint (crm.mysite.com/reports/view). That path returns the following authentication notice:
Authentication Required
The server http://crm.mysite.com:80 requires a username and password.
I am not aware of anything special for that endpoint and, as I mentioned, it works without issues when deployed under the main site.
What would cause this? How do I remove/prevent it?
I don't even know what code to provide to help diagnose the problem. Please let me know if you want to see parts of the code for any section related to this issue.
UPDATE:
I don't move the path to the application files for either situation and they both use the same application pool. The only difference is how a user access the files via IIS.
UPDATE2:
If I authenticate a user, I get this error:
Server Error in '/Reports' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Why would it think the resource doesn't exist when clearly it does?
If you have authentication on the main site, it won't automatically carry authentication across to the sub-domain. You would have to develop a mechanism to handle that such as SSO (single sign on).
Another potential issue is permissions for the directory/application (eg. c:\inetpub\wwwroot\crm.mysite.com)

Resources