Trigger Custom Pipeline without credentials
Asked by Mikhail Klimenko:

Hello,

I want to start a custom pipeline from another pipeline, but I want it to be activated by the **same** user who activated the initial pipeline on the **same** branch and the **same** repository. It looks reasonable to me that it should be possible without creating additional users and app passwords in that case. A user is running the pipeline already, right? Why does he need extra authentication? :-)

For Pull-Request reports delivery there's a possibility to send requests with curl using proxy server (*<http://localhost:29418>*) bypassing the credentials verification. Is it possible to use the same approach to trigger pipelines?

Here's what I tried (without success, but works fine when replacing proxy parameter user credentials):

```
curl?--proxy 'http://localhost:29418'
-X POST -is -H 'Content-Type:application/json' 
https://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/pipelines/
-d '{
"target":{
 "type":"pipeline_ref_target",
 "ref_type":"branch",
 "ref_name":"$BITBUCKET_BRANCH",
 "selector":{"type":"custom","pattern":"Run autotests"}}
}'
```

Thanks!


Answers:
author: Theodora Boudale
body: Hi Mikhail and welcome to the community.

The current proxy only works for pushing back to the repo where Pipelines is running during a Pipelines build, and also with the reports and annotations API endpoints. It is not designed to work with any other endpoints, so I'm afraid that what you're asking is not possible at the moment.

You will need to use authentication in the API call. You can also use the following pipe to trigger another pipeline:

* <https://bitbucket.org/atlassian/trigger-pipeline/src/master/>

That also requires a username and app password for authentication.

I can create a feature request in our issue tracker about what you're asking, for our product managers and development team to consider. Please feel free to let me know if you'd like me to do that.

Kind regards,  
Theodora

comments: author: Mikhail Klimenko
body: Hi Theodora,

Thank you for your response! I've already implemented it using dedicated user's credentials.

All the same, I still think it may be a nice to have feature, because it allows getting rid of that extra user and app password.


author: Theodora Boudale
body: Hi Mikhail,

Thank you for your reply and feedback

I went ahead and created a feature request in our issue tracker:

* <https://jira.atlassian.com/browse/BCLOUD-21842>

I would suggest adding your vote to the feature request (by selecting the **Vote for this issue** link) as the number of votes helps the development team and product managers better understand the demand for new features.

You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature request.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


author: Mikhail Klimenko
body: Thank you for it, Theodora! I did vote for it.


author: Theodora Boudale
body: You are very welcome Mikhail! Please feel free to reach out if you ever need anything else.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud