Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional login parameter for Cloud Foundry #5174

Closed
CargillRamya opened this issue Nov 14, 2024 · 11 comments
Closed

Additional login parameter for Cloud Foundry #5174

CargillRamya opened this issue Nov 14, 2024 · 11 comments

Comments

@CargillRamya
Copy link

I'm trying to create a job on Continuous Integration and Delivery system to deploy application to the BTP. On my local, I'm using the platform user on IAS to access Cloud Foundry space by adding "--origin " parameter to the "cf login" command and it works as expected. I want to provide the same parameter on my CI/CD job.

Below is the same config.yml file

steps:
cloudFoundryDeploy:
cloudFoundry:
collectTelemetryData: false
credentialsId:
loginparameters: --origin ***
apiEndpoint: 'https://api.cf.eu10-004.hana.ondemand.com'
org:
space:
mtaPath: '*.mtar'

But this doesn't seem to work. I get an error in Jenkins as mentioned in attachment. Any idea how I can set this parameter?

image
@srinikitha09
Copy link
Contributor

Hi Ramya,

Are you using technical user to do the deployment? Are you also passing the credentialId ?

Thanks and Regards,
Nikitha

@CargillRamya
Copy link
Author

Yes I'm using Technical id & passing credentialId. Can you please refer the snippet I had attached.

Thanks,
Ramya

@CargillRamya
Copy link
Author

Also, one additional input from my end: We've provided space developer access to the corresponding space and established platform trust with IAS

@srinikitha09
Copy link
Contributor

srinikitha09 commented Dec 10, 2024

Hi Ramya,

If you would like to use the custom IDP to login to cloud foundry, you could configure the credentials of type "Basic Authentication for Custom IDP" as described here. I hope that should help you.

Thanks,
Nikitha

@CargillRamya
Copy link
Author

Hi Srinikitha,

Thanks for your response!

As per your comment I think the solution points to SAP's Continuous Integration System. But, we're using Jenkins for CI/CD along with Piper Library for CloudFoundry deploy by referring to the solution in this link https://www.project-piper.io/steps/cloudFoundryDeploy/#cfcredentialsid.

So, can you please support how this issue can be resolved for the same?

Thanks in advance.

@srinikitha09
Copy link
Contributor

Hi Ramya,
Are you passing the value to loginParameters as a string for ex. loginParameters: '--origin ****'?

@CargillRamya
Copy link
Author

Hi SriNikitha,

Yes you're right that's how I had passed in config.yml file

@CargillRamya
Copy link
Author

Hi @srinikitha09 : Any updates on how this can be solved?

@srinikitha09
Copy link
Contributor

Hi Ramya,
Does your password contains any special characters?

Thanks,
Nikitha

@CargillRamya
Copy link
Author

Hi @srinikitha09 : The issue got resolved now, after making below changes.

Changes made:

  1. Intermediary stage cloudFoundry was removed.
  2. Renaming of parameters was done since they were deprecated as per Piper document
    credentialsId -> cfCredentialsId
    apiEndpoint -> cfApiEndpoint
    org -> cfOrg
    space -> cfSpace
    These fixed the issue with loginParameters

@srinikitha09
Copy link
Contributor

srinikitha09 commented Jan 8, 2025

Hi @srinikitha09 : The issue got resolved now, after making below changes.

Changes made:

  1. Intermediary stage cloudFoundry was removed.
  2. Renaming of parameters was done since they were deprecated as per Piper document
    credentialsId -> cfCredentialsId
    apiEndpoint -> cfApiEndpoint
    org -> cfOrg
    space -> cfSpace
    These fixed the issue with loginParameters

Hi,
Strange to know that using deprecated parameters would end up with invalid grant error. I would rather expect a different error. However, good to know that the issue is resolved.

Thanks,
Nikitha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants